Author Topic: Installing libcurl to codeblocs  (Read 8943 times)

muzzex

  • Guest
Installing libcurl to codeblocs
« on: April 15, 2015, 12:37:58 pm »
Hi All,

I've been trying so long, but I can't see what I'm doing wrong.

I have downloaded the latest version of libcurl, but I get error message when trying to use it:
No such file or directory

If I look at the exact path it is looking for, the file is there.

I have change the settings in Build Options: Seach Directories: compiler and linker, and Linker Settings.
The linker settings include the .lib file.
The search directories include the include directory. Under this is the curl folder which contains all .h files.
I have the same for Compiler and Linker.

I have put the .exe file in the Windows/System32 folder.
I have copied the dll files and the .h fiiles to all directories where I run my project.
I feel I have followed the tutorials exactly found on the internet.

I am not aware of static/dynamic linking. Is that the problem?

Would be great if you could help me out!

Here is my code:
 #include <stdio.h>
 #include <curl/curl.h>

 int main(void)
 {
   CURL *curl;
   CURLcode res;

   curl = curl_easy_init();
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
     res = curl_easy_perform(curl);
      /* always cleanup */
    curl_easy_cleanup(curl);
   }
   return 0;
 }

Error message:
\Users\Ola\Documents\cpp\Libraries\curl-7.34.0-win64\lib\libcurl.lib||No such file or directory|

That file is placed in that exact directory where it says it can't find it.

m.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Installing libcurl to codeblocs
« Reply #1 on: April 15, 2015, 05:51:10 pm »
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

The things you said you did are NOT really smart very often; so, you might wish to look for a better website to learn from or verify you really understood the directions on the one you are using. I have no idea how to use the library you wish to use.

Edit: I have gotten an example program to work with MinGW GCC and DLL build of libCurl
Edit3: Link to example project https://github.com/stahta01/stahta01.github.io/tree/master/CodeBlocks/CB_NetWork_Examples/libCurl/libCurl_GetInfo Tested using CB 13.12.

NOTE: The library seems to default to DLL usage instead of shared usage to do static build I believe CURL_STATICLIB should be defined.

Tim S.
« Last Edit: April 15, 2015, 06:57:27 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org