2

Edit: I used this guide, and it solved my issue! However, i get another error now: 32-make.exe[1]: *** [Debug/main.cpp.o] Error 1 mingw32-make.exe: *** [All] Error 2 API.mk:97: recipe for target 'Debug/main.cpp.o' failed...

I have been trying for a couple of hours now, to link curl into my c++ project in CodeLite. Im a total noob, but i have tried a lot of things, but it does'nt seek to work. i have tried going to

project settings > linker > and changing the options to where my files are at. So for example, in "Libraries search path" I wrote:

 C:\Users\Mio\Documents\curl-7.46.0-win64\lib\libcurl.lib;
 C:\Users\Mio\Documents\curl-7.46.0-win64\lib\libcurl.lib;
 C:\Users\Mio\Documents\curl-7.46.0-win64\lib\libcurl_a.lib;`

and in libraries I wrote

 C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\libcurl.a`

The error I am getting is:

 C:/Users/Mio/Documents/test27/API/main.cpp:4:23: fatal error: curl/curl.h: No such file or directory`

CodeLite's own tutorial is for an older version, and I don't quite get what I am supposed to do. Please help!

Mio Crona
  • 21
  • 4
  • Check out [this](http://stackoverflow.com/questions/34121370/how-do-i-add-libraries-to-codelite-projects) answer and set up your `Include Paths` as well before compiling. – Steeve Feb 08 '17 at 13:06
  • I used [this](http://en.sfml-dev.org/forums/index.php?topic=18820.0) guide, and it solved my issue! However, i get another error now: `32-make.exe[1]: *** [Debug/main.cpp.o] Error 1 mingw32-make.exe: *** [All] Error 2 API.mk:97: recipe for target 'Debug/main.cpp.o' failed`... – Mio Crona Feb 08 '17 at 18:12

2 Answers2

1

First its important to understand which compiler you use. By the look of it, it seems that you have downloaded the libcurl binaries for Visual Studio, but the error message you get from the compiler looks like a MinGW one...

So the first step is to download proper package for MinGW

Next, this error:

C:/Users/Mio/Documents/test27/API/main.cpp:4:23: fatal error: curl/curl.h: No such file or directory

Is a compiler error, not a linker. This means gcc can not find the header file curl/curl.h. You should add the path to the include folder in CodeLite's project settings->Compiler->Include paths

After this, go to project settings->Linker->Library search paths and add the path to the lib directory (which contains the library file)

Finally, add the library name in project settings->Linker->Libraries

Attached are screenshots from a sample workspace that uses curl and MinGW (in this example, I used an environment variable to define the base folder of libcurl folder):

enter image description here

enter image description here

enter image description here

Eran
  • 2,310
  • 1
  • 13
  • 13
0

In my case previous answer helped me this far that I got all compiled and linked, but when starting application itself I got error: 0xc0000135. If you run your exe not from Codelite, but directly from Debug folder, it will tell you exactly which DLLs are missing. In my case it was OpenSSL files, which I got after installing OpenSSL for Windows (x64 lite), then copied them to Debug folder, and now all works fine.