title: How do I include curl library in my C project in Code Blocks (Windows)?
body: <p>The question seems straight forward. I tried a lot of things just to include curl in my C project using the code::blocks ide but to no avail.</p>
  
  <p>I would like to use cURL's library for my console app project that needs http capabilities.
  If anyone had successfully done so, then your help is very much appreciated. :)</p>
  
  <p>What happened previously:</p>
  
  <p>-I copied all cURL files to my project and linked the libraries (the ones with .a or .lib ext.)</p>
  
  <p>-Then when I build the project. A lot of undefined reference showed up.</p>
  
  <p>This is the code I was testing:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;curl/curl.h&gt;
  
      int main()
      {
       curl_global_init( CURL_GLOBAL_ALL );
       CURL * myHandle;
       CURLcode result; 
       myHandle = curl_easy_init ( ) ;
  
       curl_easy_setopt(myHandle, CURLOPT_URL, "http://www.example.com");
       result = curl_easy_perform( myHandle );
       curl_easy_cleanup( myHandle ); 
       printf("LibCurl rules!\n");
       return 0;
      }
  </code></pre>
  
  <p>Here are the errors:</p>
  
  <pre><code>||=== Fa, Release ===|
  obj\Release\main.o:main.c|| undefined reference to `_imp__curl_global_init'|
  obj\Release\main.o:main.c|| undefined reference to `_imp__curl_easy_init'|
  obj\Release\main.o:main.c|| undefined reference to `_imp__curl_easy_setopt'|
  obj\Release\main.o:main.c|| undefined reference to `_imp__curl_easy_perform'|
  obj\Release\main.o:main.c|| undefined reference to `_imp__curl_easy_cleanup'|
  ||=== Build finished: 5 errors, 0 warnings ===|
  </code></pre>