即使在安装了curl和所有相关的libcurl包之后,例如
卷曲 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
任何帮助表示赞赏
答案1
问题不在于缺少一个_curl_
库,而是libcurl.so.4
引用了未找到的库的函数。从缺失函数的名称可以看出,这应该是libssl
.
ldd
您可以使用on来调查缺少哪个确切的库libcurl.so
:
$ ldd /usr/lib/x86_64-linux-gnu/libcurl.so.4
它会向您报告丢失的库
libssl.so.1.0.0 not found
答案2
libssl 似乎不再包含以 SSLv3 开头的符号。相反,您应该针对 libgnutls-openssl 进行编译[插入任何内容]。
我是从调查为什么在 debian stable (jessie) 上运行时curl 不会链接到该符号的角度来讨论的。重新编译curl,在Makefiles 的CFLAGS 中添加一些-lgnutls-openssl 似乎可以解决问题。
我怀疑这种混乱是如何产生的,但没有兴趣去询问任何人!
答案3
对于那些在遥远的将来阅读本文并遇到类似的未解决的参考错误的人来说:
...@OPENSSL_3.X.X'
这是因为curl 或其他一些依赖于OpenSSL 3+ 的库找不到它。您的机器可能运行旧版本(可通过运行验证openssl version
)
我按照以下命令安装 OpenSSL 3.0.10 解决了这个问题本指南
修复安装后,不要忘记链接库。如果使用 CMake:
link_libraries(crypto ssl curl)
如果使用make
:
-lssl -lcrypto -lcurl