3
votes

I download LibCurl from http://curl.haxx.se/download.html (zip type), after I extract, I notice there is Include and Lib folder that has source codes, so I copy those to CodeBlocks project and include it, however when I build it show error

fatal error: curl/curlbuild.h: No such file or directory

The file is inside Include folder and I have included in my project

This is the project structure I create to compile LibCurl

I am new in C++ and using CodeBlocks, I plan to compile the LibCurl library into static lib file and include in my project, how do I do it? Please help, since the LibCurl by default only come with dsw Microsoft Visual C++ project file and I need to compile it into CodeBlocks (GNU GCC)

3

3 Answers

2
votes

According to the docs/INSTALL file in CURL's source archive, you should build CURL from the command line. If you are using MinGW (bundled with CodeBlocks), you need to make sure the MinGW bin directory is in your PATH variable (set PATH=<path_to_mingw>\bin;%PATH%) and then run mingw32-make mingw32 in CURL's root directory

0
votes

The LibCurl is other project? Try put the Headers and the Includes of CURL in LearnCPP project.

0
votes

It sounds like you'll need to set the include dir to whatever directory has the curl folder. Look for this in your compiler options - it should correspond to the -I option. Note that if it includes a makefile, you should use that instead. Enable it in the project settings.