lasote / conan-libcurl

Lib curl library package for conan
2 stars 12 forks source link

Linking issues on Windows+Visual Studio 2017 #12

Open piponazo opened 7 years ago

piponazo commented 7 years ago

Hi, I am trying to consume the recipe and I and having this problem on Windows + Visual Studio 2017:

libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateContext referenced in function schannel_connect_step3

Note that this happens when I try to link against libcurl in other project. The libcurl package itself can be compiled normally.

I have been investigating a bit the issue and it might be that the library Crypt32.lib is not used when compiling with MSVC 14.1:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa376075%28v=vs.85%29.aspx

solvingj commented 6 years ago

@piponazo did you ever find any answer to this? We're probably going to fork this repo.

ForNeVeR commented 6 years ago

I've solved the issue in my application by adding the following to my CMakeLists.txt:

target_link_libraries(myappname
    crypt32
)
piponazo commented 6 years ago

I did not try that again, but the solution found by @ForNeVeR makes sense. Probably this library should be linked for generating the libcurl library.