title: C++: Libcurl curl_easy_init() gives an access violation error and crashes the program
body: <p>I'm trying to use libcurl with a program I'm making, but I'm having some problems with it. So far I've only tried the examples from libcurl's website, but they crash as soon as the program gets to the curl initialization.</p>
  
  <p>My current code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;curl/curl.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://garrysmod.fi/");
          res = curl_easy_perform(curl);
  
          curl_easy_cleanup(curl);
      }
  
      return 0;
  }
  </code></pre>
  
  <p>I have also made sure the compiler and linker can find the resources, and that the dll file (libcurl.dll) is in the program's folder, yet it keeps crashing.
  I tried debugging with VS2010, and it gave me an "access violation" error at the initialization function curl_easy_init().</p>
  
  <p>Any help would be appreciated!</p>