1
votes

I'm having some unknown issue trying to use the curl library in my c++ application.

This is what I have done so far:

  1. Download latest version of curl
  2. Build curl "nmake /f Makefile.vc mode=dll VC=12" - i get the following folders and files:

    bin -> libcurl.dll

    include -> curl -> bunch of .h files

    lib -> libcurl.lib

  3. Next I open Visual Studio 2015 Update 3 and go to Configuration Properties:

    C/C++ -> General -> Additional include directories -> ..\curl\include

    and

    Linker-->Input->Additional Dependencies--> ..\curl\lib\libcurl.lib

    and then copy the .dll to the debug folder.

This procedure has worked for me for another library but for CURL i am getting the error message:

"Error LNK1104 cannot open file '..\curl\libcurl.lib'"

I can #include "curl\curl.h" without any errors. Problem seems to be with the lib file. I have been looking all over the web for 6 hours, I'm totally lost.

1
Just an observation, I am not very familiar with VS. Your error says it is looking in ..\curl\ for libcurl.lib whereas you are saying it is in ..\curl\lib\. It is probably not an issue with libcurl.lib.Alden
I'm not sure how to describe this but randomly tried to build it again for the 10th time and no error. I'm actually speechless...jones
I have 1 system where it's fixed and another where it's not, i can report back tomorrow when I find the issuejones
It worked when the path was set correct, i had several windows opened so i messed it upjones

1 Answers

0
votes

The general preferred usage in VS is to specify additional library directories (Linker->General->Additional Library Directories) where you specify the path of your curl lib.

Then add the libcurl.lib to your additional linker dependencies.