title: Can't compile in Linux with curl - undefined reference
body: <p>I'm trying to compile a c++ sample in Linux(ubuntu) using curl lib but I'm getting undefined reference to 'curl_easy_init'</p>
  
  <p>Compile command: </p>
  
  <pre><code>gcc -L/usr/local/lib -lcurl -I/usr/local/include -o request request.cpp
  </code></pre>
  
  <p>result:<br></p>
  
  <pre><code>/tmp/ccZwDiCf.o: In function 'main':&lt;br&gt;
  request.cpp:(.text+0xa): undefined reference to 'curl_easy_init'&lt;br&gt;
  request.cpp:(.text+0x31): undefined reference to 'curl_easy_setopt'&lt;br&gt;
  request.cpp:(.text+0x3d): undefined reference to 'curl_easy_perform'&lt;br&gt;
  request.cpp:(.text+0x54): undefined reference to 'curl_easy_strerror'&lt;br&gt;
  request.cpp:(.text+0x7b): undefined reference to 'curl_easy_cleanup'&lt;br&gt;
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>#include &lt;curl/curl.h&gt;
  #include &lt;stdio.h&gt;
  
  int main(int argc, char* argv[]){
      CURL *curl;
      CURLcode res;
  
      curl = curl_easy_init();
      if(curl) {
          curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");
          res = curl_easy_perform(curl);
          if(res!=CURLE_OK) 
              fprintf(stderr, "curl_easy_perform() failed: %s\n",curl_easy_strerror(res));
          curl_easy_cleanup(curl);
      }
      return 0;
  }
  </code></pre>