在C ++中使用NuGet中的libcurl(VS2013) [英] Using libcurl from NuGet in C++ (VS2013)

查看:1008

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆