2

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
Community
  • 1
  • 1
rwllr
  • 23
  • 1
  • 3

2 Answers2

4

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.

Community
  • 1
  • 1
evoskuil
  • 1,011
  • 1
  • 7
  • 13
  • I'm having this issue too - how do you override this (you mention 'targets will have to be updated') – Edge Apr 29 '15 at 06:35
  • This can be done between compatible compilers (such as v120 and CPT_Nov2013) but not between v110 and v120/CPT_Nov2013. I ended up building OpenSSL and publishing my NuGet packages. See https://www.nuget.org/packages?q=evoskuil But I dropped cURL altogether. – evoskuil Apr 29 '15 at 16:54
-1

These are OpenSSL functions, which are used by curl. Strange that a package management system like nuget doesn't have automatic dependency tracking. In any case, installing OpenSSL in the same way you installed curl should resolve your issue.

rubenvb
  • 74,642
  • 33
  • 187
  • 332
  • Thanks for pointing that out to me. NuGet downloads the other packages as well, so I had to add them also in project properties. That said, still have the same error. – rwllr Feb 02 '14 at 18:14