Dynamic-Linking

libcurl.so.4 未定義的引用錯誤

  • June 3, 2015

即使在安裝 curl 和所有相關的 libcurl 包之後,例如

curl libcurl3 libcurl3-gnutls

libcurl4-doc

libcurl4-nss-dev

libcurl-ocaml

libcurl3-dbg

libcurl3-nss

libcurl4-gnutls-dev

libcurl4-openssl-dev

libcurl-ocaml-dev

我收到錯誤,例如,

/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_verify@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_STRING_type@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `CRYPTO_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_shutdown@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_verify_result@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `d2i_PKCS12_fp@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `EVP_cleanup@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_write@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_peek@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BIO_new@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_set_fd@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_privatekey@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BN_num_bits@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_connect@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `DES_set_odd_parity@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_egd@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_srp_password@OPENSSL_1.0.1'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_get_pubkey@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_init@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_set_connect_state@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_get_cert_store@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_NAME_get_entry@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_free_strings@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_add@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_ctrl@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `sk_pop_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BIO_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `GENERAL_NAMES_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_get_id@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_library_init@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_ctrl@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_STRING_print@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_NAME_ENTRY_get_data@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_get_next@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_get_error@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_file_name@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `CRYPTO_cleanup_all_ex_data@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_default_passwd_cb_userdata@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_use_certificate_file@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BN_bn2bin@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_peer_cert_chain@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_check_issued@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_clear_error@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_pending@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BIO_s_mem@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `EVP_PKEY_copy_parameters@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSLv23_client_method@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_add_client_CA@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_use_PrivateKey@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_get_serialNumber@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_callback_ctrl@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD4_Update@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD4_Final@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `PEM_read_X509@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSLeay@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_get_first@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_get_subject_name@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD5_Final@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_load_builtin_engines@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_ctrl@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509V3_EXT_print@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_load_error_strings@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_set_session@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_NAME_get_index_by_NID@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_ctrl_cmd@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `TLSv1_client_method@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_check_private_key@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_by_id@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_certificate@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSLv3_client_method@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_verify_cert_error_string@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_peer_certificate@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_new@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `OPENSSL_add_all_algorithms_noconf@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `sk_value@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_use_PrivateKey_file@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_EXTENSION_get_object@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_INTEGER_get@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_get_ext_d2i@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_load_crl_file@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_cipher_list@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `DES_set_key@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get1_session@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_peek_error@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_STORE_add_lookup@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_current_cipher@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_STRING_to_UTF8@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_load_private_key@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `PEM_write_bio_X509@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_finish@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD4_Init@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `CRYPTO_malloc@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `PKCS12_PBE_add@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_cleanup@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD5_Init@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `PKCS12_parse@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `UI_OpenSSL@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_get_issuer_name@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `EVP_PKEY_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_error@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_default_passwd_cb@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_error_string_n@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BIO_ctrl@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_new@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_shutdown@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_STORE_CTX_get_current_cert@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_SESSION_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_STRING_length@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `sk_pop@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `DES_ecb_encrypt@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_status@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_LOOKUP_file@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_use_certificate@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_STORE_set_flags@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_read@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_set_default@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_STRING_data@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_srp_username@OPENSSL_1.0.1'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_load_file@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_load_verify_locations@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `i2t_ASN1_OBJECT@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_remove_thread_state@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_bytes@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD5_Update@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CIPHER_get_name@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_EXTENSION_get_critical@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `PKCS12_free@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `sk_num@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_error_string@OPENSSL_1.0.0'
/usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_NAME_print_ex@OPENSSL_1.0.0'
collect2: error: ld returned 1 exit status

任何幫助表示讚賞

libssl 似乎不再包含以 SSLv3 開頭的符號。相反,您應該編譯

$$ insert whatever it is $$針對 libgnutls-openssl。 我是從調查為什麼 curl 在執行時不會在 debian stable (jessie) 上鍊接該符號的角度說的。重新編譯 curl 添加一些 -lgnutls-openssl 到 Makefile 中的 CFLAGS 似乎可以解決問題。

我懷疑這種混亂是如何產生的,但幾乎沒有詢問任何人的意願!

問題不在於_curl_缺少庫,而是libcurl.so.4引用了未找到的庫的函式。從缺失函式的名稱中可以看出,這應該是libssl.

您可以使用lddon調查缺少哪個確切的庫libcurl.so

$ ldd /usr/lib/x86_64-linux-gnu/libcurl.so.4

它會像你一樣向你報告失去的庫

libssl.so.1.0.0 not found

引用自:https://unix.stackexchange.com/questions/125918