Write an HTTP request from C++ using libcurl.
Using Windows 7 (64-bit) + eclipse MARS (64-bit ) + curl 7.40.0 (64-bit). I configured the Include (-I) and Library (-L) in Compiler (GCC C++ Compiler) and Linker (MinGW).
However, I keep getting "undefined reference to `_imp__curl_easy_init'" error.
Below is the code:
#include
#include
int main() {
CURL *curl;
std::cout << "Before";
curl = curl_easy_init();
std::cout << "After";
return 0;
}
Here i keep getting "undefined reference to `_imp__curl_easy_init'" error for curl 7.40.0 (64-bit).
Later I downloaded, curl 7.19.3-win32 version and tried same settings for Include and Library. This time, there are no compilation errors but the code terminates automatically without any errors.
With curl 7.19.3-win32 version, In the above code nothing is printed on console and program terminates.
If I comment out line ‘curl =
curl_easy_init();' both couts are printed.
I am using Windows 7 + eclipse MARS, both 64-bit.