I have Win7x64 and Visual Studio 2012 Express .

  1. Download this version of cURL: Win32 - MSVC 7.18.0.
  2. In the project properties I specified paths to directories with .lib and .h files.
  3. In linker added libcurl.lib .
  4. I threw libcurl.dll into the Debug folder with the exe file. (Otherwise, the program says that it can not find it).

Here is the main.cpp code (taken from the site with examples):

 #include <stdio.h> #include <curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* Выполнение запроса, res будет содержать код возврата */ 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; } 

It seems everything is compiled, but at startup it climbs this:

Error starting application (0xc000007b). To exit the application, click "OK."

How can this be fixed?


UPD: When I compile in x64:

 error LNK2019: ссылка на неразрешённый внешний символ __imp_curl_easy_strerror в функции main error LNK2019: ссылка на неразрешённый внешний символ __imp_curl_easy_init в функции main error LNK2019: ссылка на неразрешённый внешний символ __imp_curl_easy_setopt в функции main error LNK2019: ссылка на неразрешённый внешний символ __imp_curl_easy_perform в функции main error LNK2019: ссылка на неразрешённый внешний символ __imp_curl_easy_cleanup в функции main error LNK1120: неразрешённых внешних элементов: 5 
  • Did you try to run under the debugger? Which line leads to an error? - VladD 4:06 pm
  • Compiled it under Linux. Everything compiled and worked as expected ( curl_easy_perform returns 0). I suspect that the library is compiled with multithreading support, and your code is not. - KoVadim
  • @VlaD, curl = curl_easy_init (); - ololo
  • @KoVadim, how to enable support? - ololo
  • when compiling 64bit it should be so - the library then you have 32bit. But to include support - look for this in the project settings - options /MD /MT and play with them . - KoVadim

0