2

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.

4
  • 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
    Feb 21, 2017 at 22:44
  • 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
    Feb 21, 2017 at 23:20
  • I have 1 system where it's fixed and another where it's not, i can report back tomorrow when I find the issue
    – jones
    Feb 21, 2017 at 23:33
  • It worked when the path was set correct, i had several windows opened so i messed it up
    – jones
    Mar 1, 2017 at 12:47

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.