使用 OpenSSL 构建 LibCurl 会导致链接器错误
我已经尝试构建支持 SSL 的 LibCurl 2 天了,我已经遵循了互联网上的所有指南,并且用 google 搜索了几个小时的错误。我终于让它编译得很好,但是当我链接到它时,我收到下面列出的链接器错误。
我正在构建...
nmake -f Makefile.vc9 OPENSSL_PATH=c:\dev_mms\openSSL RTLIBCFG=static CFG=release-ssl
以下错误,当我用 google 搜索时,他们说有关 OpenSSL 库未正确链接的内容,但我查看了 Makefile.vc9,它肯定包含 OpenSSL 的正确库。以下是链接器错误(我删除了大约 50 个错误只是为了缩短它),我该如何解决这些错误?
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _RAND_status referenced in function _rand_enough
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _RAND_file_name referenced in function _ossl_seed
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _RAND_load_file referenced in function _ossl_seed
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_CTX_check_private_key referenced in function _cert_stuff
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_free referenced in function _cert_stuff
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _BN_num_bits referenced in function _get_cert_chain
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _X509_get_serialNumber referenced in function _get_cert_chain
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _ASN1_INTEGER_get referenced in function _get_cert_chain
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _X509_get_issuer_name referenced in function _get_cert_chain
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_get_peer_cert_chain referenced in function _get_cert_chain
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _X509_verify_cert_error_string referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_get_verify_result referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _X509_check_issued referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _PEM_read_X509 referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _X509_free referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_get_peer_certificate referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_get1_session referenced in function _ossl_connect_step3
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_pending referenced in function _Curl_ossl_data_pending
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_write referenced in function _ossl_send
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSLeay referenced in function _Curl_ossl_version
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _DES_set_key referenced in function _setup_des_key
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _DES_set_odd_parity referenced in function _setup_des_key
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _DES_ecb_encrypt referenced in function _lm_resp
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD4_Final referenced in function _mk_nt_hash
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD4_Update referenced in function _mk_nt_hash
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD4_Init referenced in function _mk_nt_hash
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD5_Final referenced in function _Curl_output_ntlm
1>libcurl.lib(md5.obj) : error LNK2001: unresolved external symbol _MD5_Final
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD5_Update referenced in function _Curl_output_ntlm
1>libcurl.lib(md5.obj) : error LNK2001: unresolved external symbol _MD5_Update
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD5_Init referenced in function _Curl_output_ntlm
1>libcurl.lib(md5.obj) : error LNK2001: unresolved external symbol _MD5_Init
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _RAND_bytes referenced in function _Curl_output_ntlm
I have been trying to build LibCurl with SSL support for 2 days now, and I have followed about every guide on the internet, and google'd errors for hours. I finally got it to compile fine, but when I link to it, I am getting the linker errors listed below.
I am building with...
nmake -f Makefile.vc9 OPENSSL_PATH=c:\dev_mms\openSSL RTLIBCFG=static CFG=release-ssl
The following errors, when I google'd them said something about the OpenSSL libs not being linked to properly, but I looked at Makefile.vc9, and it definitely is including the proper libs for OpenSSL. Here are the linker errors (I removed about 50 of them just to shorten it), what can I do to resolve these?
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _RAND_status referenced in function _rand_enough
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _RAND_file_name referenced in function _ossl_seed
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _RAND_load_file referenced in function _ossl_seed
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_CTX_check_private_key referenced in function _cert_stuff
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_free referenced in function _cert_stuff
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _BN_num_bits referenced in function _get_cert_chain
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _X509_get_serialNumber referenced in function _get_cert_chain
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _ASN1_INTEGER_get referenced in function _get_cert_chain
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _X509_get_issuer_name referenced in function _get_cert_chain
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_get_peer_cert_chain referenced in function _get_cert_chain
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _X509_verify_cert_error_string referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_get_verify_result referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _X509_check_issued referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _PEM_read_X509 referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _X509_free referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_get_peer_certificate referenced in function _servercert
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_get1_session referenced in function _ossl_connect_step3
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_pending referenced in function _Curl_ossl_data_pending
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSL_write referenced in function _ossl_send
1>libcurl.lib(ssluse.obj) : error LNK2019: unresolved external symbol _SSLeay referenced in function _Curl_ossl_version
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _DES_set_key referenced in function _setup_des_key
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _DES_set_odd_parity referenced in function _setup_des_key
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _DES_ecb_encrypt referenced in function _lm_resp
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD4_Final referenced in function _mk_nt_hash
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD4_Update referenced in function _mk_nt_hash
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD4_Init referenced in function _mk_nt_hash
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD5_Final referenced in function _Curl_output_ntlm
1>libcurl.lib(md5.obj) : error LNK2001: unresolved external symbol _MD5_Final
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD5_Update referenced in function _Curl_output_ntlm
1>libcurl.lib(md5.obj) : error LNK2001: unresolved external symbol _MD5_Update
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _MD5_Init referenced in function _Curl_output_ntlm
1>libcurl.lib(md5.obj) : error LNK2001: unresolved external symbol _MD5_Init
1>libcurl.lib(http_ntlm.obj) : error LNK2019: unresolved external symbol _RAND_bytes referenced in function _Curl_output_ntlm
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要
在项目配置中添加其他依赖项。
You need to add
To additional dependencies in the project configuration.
我已按照问题 197444 (在 ssl 支持上构建 libcurl windows),它就像一个梦想。
尝试一下,让我知道进展如何。
I have followed the directions in the answer to Question 197444 (building libcurl with ssl support on windows) and it works like a dream.
Give those a shot and let me know how it goes.