title: CURL - simple example returning "CURLE_WRITE_ERROR"
body: <p>I am trying to run a simple example using libcurl, but just running this simple example gives me <code>CURLE_WRITE_ERROR</code> when I execute the <code>curl_easy_perform(...)</code> command. Does anyone have any idea what I am doing wrong? I have also tried other sites besides example.com.</p>
  
  <pre><code>CURL *curl = curl_easy_init();
  
  if(curl) 
  {
      CURLcode res;
      curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
      res = curl_easy_perform(curl); // returns CURLE_WRITE_ERROR always!
      curl_easy_cleanup(curl);
  }
  </code></pre>