Quantcast
Viewing all articles
Browse latest Browse all 22057

Include openssl/libcrypto statically

I am trying to compile an app with static curl and i it seems OpenSSL is not properly linked.

COMPILE CMD:

$(CXX) $(CXXFLAGS) program1.cpp /opt/curl-7.62.0/lib/libcurl.a /opt/openssl-1.1.1a/lib/libcrypto.a -o program1 -L/opt/curl-7.62.0/ -L/opt/openssl-1.1.1a/ -Wwrite-strings -fpermissive -static-libstdc++ -lcrypto -lssl -lcurl -Wl,-Bstatic -lidn2 -lrt -lz -Wl,-Bdynamic -ldl -lpthread 

CURL:

rm -rf /opt/curl-7.62.0/*; ./configure --prefix=/opt/curl-7.62.0 --with-pic --disable-shared --enable-static --with-libidn=/opt/libidn2-2.0.4 --with-ssl=/opt/openssl-1.1.1a --without-librtmp --without-gnutls --without-nss --without-libssh2 --with-zlib=/opt/zlib-1.2.11 --without-winidn --disable-rtsp --disable-ldap --disable-ldaps --disable-ipv6 LIBS=-ldl; make -j 8; make install; ls -al /opt/curl-7.62.0/;

OPENSSL :

./config --prefix=/opt/openssl-1.1.1a -fPIC -static; make; make install;

Errors :

/opt/curl-7.69.1/lib/libcurl.a(libcurl_la-openssl.o): In function `Curl_ossl_sha256sum':openssl.c:(.text+0x13c): undefined reference to `EVP_MD_CTX_new'openssl.c:(.text+0x177): undefined reference to `EVP_MD_CTX_free'/opt/curl-7.69.1/lib/libcurl.a(libcurl_la-openssl.o): In function `Curl_ossl_md5sum':openssl.c:(.text+0x1cc): undefined reference to `EVP_MD_CTX_new'openssl.c:(.text+0x207): undefined reference to `EVP_MD_CTX_free'/opt/curl-7.69.1/lib/libcurl.a(libcurl_la-openssl.o): In function `Curl_ossl_version':openssl.c:(.text+0xb54): undefined reference to `OpenSSL_version_num'/opt/curl-7.69.1/lib/libcurl.a(libcurl_la-openssl.o): In function `servercert':openssl.c:(.text+0x19d0): undefined reference to `X509_get0_notBefore'openssl.c:(.text+0x1a2c): undefined reference to `X509_get0_notAfter'openssl.c:(.text+0x1b29): undefined reference to `OPENSSL_sk_num'openssl.c:(.text+0x1b7f): undefined reference to `OPENSSL_sk_value'openssl.c:(.text+0x1c77): undefined reference to `X509_get_X509_PUBKEY'openssl.c:(.text+0x1caf): undefined reference to `X509_get_X509_PUBKEY'openssl.c:(.text+0x1f22): undefined reference to `OPENSSL_sk_num'openssl.c:(.text+0x1fa9): undefined reference to `OPENSSL_sk_value'openssl.c:(.text+0x207e): undefined reference to `X509_get_version'openssl.c:(.text+0x21f4): undefined reference to `X509_get_X509_PUBKEY'openssl.c:(.text+0x2272): undefined reference to `X509_get0_extensions'openssl.c:(.text+0x227d): undefined reference to `OPENSSL_sk_num'openssl.c:(.text+0x22f1): undefined reference to `OPENSSL_sk_num'openssl.c:(.text+0x2303): undefined reference to `OPENSSL_sk_value'openssl.c:(.text+0x2673): undefined reference to `X509_get0_notBefore'openssl.c:(.text+0x26cb): undefined reference to `X509_get0_notAfter'openssl.c:(.text+0x2755): undefined reference to `EVP_PKEY_get0_RSA'openssl.c:(.text+0x276f): undefined reference to `RSA_get0_key'openssl.c:(.text+0x2ac5): undefined reference to `ASN1_STRING_get0_data'openssl.c:(.text+0x2b6c): undefined reference to `EVP_PKEY_get0_DSA'openssl.c:(.text+0x2b8c): undefined reference to `DSA_get0_pqg'openssl.c:(.text+0x2b9e): undefined reference to `DSA_get0_key'openssl.c:(.text+0x2c44): undefined reference to `EVP_PKEY_get0_DH'openssl.c:(.text+0x2c64): undefined reference to `DH_get0_pqg'openssl.c:(.text+0x2c76): undefined reference to `DH_get0_key'openssl.c:(.text+0x2d15): undefined reference to `ASN1_STRING_get0_data'openssl.c:(.text+0x2d3d): undefined reference to `ASN1_STRING_get0_data'openssl.c:(.text+0x32aa): undefined reference to `ASN1_STRING_get0_data'/opt/curl-7.69.1/lib/libcurl.a(libcurl_la-openssl.o): In function `ossl_connect_step2':openssl.c:(.text+0x3461): undefined reference to `SSL_get_client_random'openssl.c:(.text+0x3476): undefined reference to `SSL_SESSION_get_master_key'/opt/curl-7.69.1/lib/libcurl.a(libcurl_la-openssl.o): In function `ossl_connect_step1':openssl.c:(.text+0x3f51): undefined reference to `TLS_client_method'openssl.c:(.text+0x40b3): undefined reference to `SSL_CTX_set_options'openssl.c:(.text+0x545c): undefined reference to `OPENSSL_sk_pop_free'openssl.c:(.text+0x55fe): undefined reference to `OPENSSL_sk_pop'openssl.c:(.text+0x5640): undefined reference to `OPENSSL_sk_num'openssl.c:(.text+0x566c): undefined reference to `OPENSSL_sk_pop_free'collect2: error: ld returned 1 exit statusMakefile:11: recipe for target 'main' failed....

What could it be?

Thank you.


Viewing all articles
Browse latest Browse all 22057

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>