在C ++中使用NuGet中的libcurl(VS2013) [英] Using libcurl from NuGet in C++ (VS2013)
问题描述
这里的第一个定时器,所以我可能需要一个位
。我一直在试图使用简单的libcurl示例但我编译时跳闸。
我试图使用NuGet,并按照我在
在项目属性中,我已将其他库目录链接到libcurl的文件夹。 dll in and in Linker-> Input 我在前面的答案中列出了.lib。
当我尝试运行它,它给出一个关于缺少.libs的错误。
1> LINK:致命错误LNK1104:打开文件'libeay32.lib'
我想这不是太令人惊讶,因为.lib实际上不在文件夹中。当删除对.lib的引用,除了libcurl.lib,因为那里,我得到这个错误。
1& obj:error LNK2019:未解析的外部符号__imp__curl_easy_init在函数_main中引用
1> Source.obj:error LNK2019:未解析的外部符号__imp__curl_easy_setopt在函数_main
中引用1> Source.obj:error LNK2019:未解析的外部符号__imp__curl_easy_perform在函数_main中引用
1> Source.obj:error LNK2019:未解析的外部符号__imp__curl_easy_cleanup在函数_main中引用
< class =h2_lin>解决方案
OpenSSL NuGet包目前日期为2013年6月12日。 openssl.1.0.1.24
和 openssl.redist.1.0.1.24
包含以下条件:
$(PlatformToolset.ToLower()。IndexOf('v110'))& gt; -1
这些排除编译和链接,因为VS2013设置 PlatformToolset = v120
。目标必须更新为
v120
(以及 CTP_Nov2013
)。
更多这里了解RTM和CTP编译器之间的兼容性。
First timer here, so I may need a bit of handholding.
I've been trying to just used the simple libcurl examples but am tripping up when compiling. I'm trying to use NuGet and followed what I read in this previous answer
In Project Properties I've linked Additional Library Directories to the folder with libcurl.dll in, and in Linker->Input I've the .lib's listed there in that previous answer. When I try and run it, it gives an error about missing .libs.
1>LINK : fatal error LNK1104: cannot open file 'libeay32.lib'
I guess that's not too surprising because the .lib's aren't actually in the folder. When removing references to the .lib's except for libcurl.lib because that is there, I get this error.
1>Source.obj : error LNK2019: unresolved external symbol __imp__curl_easy_init referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__curl_easy_setopt referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__curl_easy_perform referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol __imp__curl_easy_cleanup referenced in function _main
The OpenSSL NuGet package is currently dated June 12, 2013. The targets files for both openssl.1.0.1.24
and openssl.redist.1.0.1.24
contain the following condition:
$(PlatformToolset.ToLower().IndexOf('v110')) > -1
These preclude compilation and linking because VS2013 sets PlatformToolset = v120
by default. The targets will have to be updated for v120
(and for CTP_Nov2013
).
More here on compatibility between RTM and CTP compilers.
这篇关于在C ++中使用NuGet中的libcurl(VS2013)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!