简体   繁体   English

在Windows 10上从源代码编译libcurl 7.61.1

[英]compiling libcurl 7.61.1 from source on Windows 10

I'm working on an existing C++ project. 我正在研究一个现有的C ++项目。 We include libcurl as a static library, which we build from source. 我们将libcurl作为静态库包含在内,它是从源代码构建的。 I'm trying to upgrade us from version 7.38.0 to version 7.61.1. 我正在尝试将我们从7.38.0版本升级到7.61.1版本。

I downloaded curl-7.61.1.zip from here: https://curl.haxx.se/download/ . 我下载curl-7.61.1.zip从这里: https://curl.haxx.se/download/

I made no modifications to the source and did not run any scripts that came with curl 7.61.1. 我没有对源代码做任何修改,也没有运行curl 7.61.1附带的任何脚本。

We have an existing VS solution we used for compiling curl 7.38.0, so I started from that and modified as needed for the new files in curl 7.61.1. 我们有一个用于编译curl 7.38.0的现有VS解决方案,因此我从此开始,并根据需要对curl 7.61.1中的新文件进行了修改。

Everything compiled fine, however, when I try to link the compiled result into my project, I get the following errors: 一切都编译良好,但是,当我尝试将编译结果链接到项目中时,出现以下错误:

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

Has anyone run into similar issues before? 有人遇到过类似的问题吗? Please let me know if I need to edit this with more info as well. 请让我知道是否需要同时编辑更多信息。

As Peter mentioned in a comment, I needed to link against windows libraries. 正如Peter在评论中提到的那样,我需要链接Windows库。 In this case, linking against crypt32.lib solved the issue for me. 在这种情况下,针对crypt32.lib链接为我解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM