Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/136.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Windows 10上从源代码编译libcurl 7.61.1 我正在研究一个现有的C++项目。我们将libcurl作为一个静态库包含进来,它是我们从源代码构建的。我正在尝试将我们的版本从7.38.0升级到7.61.1_C++_Libcurl - Fatal编程技术网

在Windows 10上从源代码编译libcurl 7.61.1 我正在研究一个现有的C++项目。我们将libcurl作为一个静态库包含进来,它是我们从源代码构建的。我正在尝试将我们的版本从7.38.0升级到7.61.1

在Windows 10上从源代码编译libcurl 7.61.1 我正在研究一个现有的C++项目。我们将libcurl作为一个静态库包含进来,它是我们从源代码构建的。我正在尝试将我们的版本从7.38.0升级到7.61.1,c++,libcurl,C++,Libcurl,我从这里下载了curl-7.61.1.zip: 我没有对源代码进行任何修改,也没有运行curl7.61.1附带的任何脚本 我们有一个用于编译curl 7.38.0的现有VS解决方案,因此我从这个解决方案开始,并根据需要对curl 7.61.1中的新文件进行了修改 一切都编译得很好,但是,当我尝试将编译的结果链接到我的项目中时,会出现以下错误: 1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __

我从这里下载了
curl-7.61.1.zip:

我没有对源代码进行任何修改,也没有运行curl7.61.1附带的任何脚本

我们有一个用于编译curl 7.38.0的现有VS解决方案,因此我从这个解决方案开始,并根据需要对curl 7.61.1中的新文件进行了修改

一切都编译得很好,但是,当我尝试将编译的结果链接到我的项目中时,会出现以下错误:

1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertOpenStore referenced in function schannel_connect_step1
1>libcurl.lib(schannel_verify.obj) : error LNK2001: unresolved external symbol __imp_CertOpenStore
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertCloseStore referenced in function schannel_connect_step1
1>libcurl.lib(schannel_verify.obj) : error LNK2001: unresolved external symbol __imp_CertCloseStore
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertFindCertificateInStore referenced in function schannel_connect_step1
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateContext referenced in function pkp_pin_peer_pubkey
1>libcurl.lib(schannel_verify.obj) : error LNK2001: unresolved external symbol __imp_CertFreeCertificateContext
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol  __imp_CryptStringToBinaryA referenced in function schannel_connect_step1
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertAddCertificateContextToStore referenced in function add_certs_to_store
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertGetNameStringA referenced in function verify_host
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CryptQueryObject referenced in function add_certs_to_store
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertCreateCertificateChainEngine referenced in function verify_certificate
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateChainEngine referenced in function verify_certificate
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertGetCertificateChain referenced in function verify_certificate
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateChain referenced in function verify_certificate
1>C:\Users\CoffeeTableEspresso\project\win64-vs15\debug-mt\executable.exe : fatal error LNK1120: 12 unresolved externals

以前有人遇到过类似的问题吗?如果我还需要编辑更多信息,请告诉我。

正如Peter在评论中提到的,我需要链接到windows库。在本例中,针对
crypt32.lib的链接为我解决了这个问题。

很可能该库现在使用了以前没有使用过的函数,因此您必须针对它进行链接。旧项目缺少此依赖关系。您可能应该确保使用与以前相同的TLS后端进行构建,以减少升级过程中可能出现的问题数量。@DanielStenberg如果我知道以前是如何构建的,..。@PeterA.Schneider您完全正确,针对
crypt32.lib的链接为我解决了这个问题