I am trying to link libCurl in QT to a C++ program on Windows 7 x64, but when I try to link libcurldll.a
, I get a huge list of errors. I have tried compiling a similar function with GCC g++ -LC:\MinGW\lib -lcurldll
which compiles without errors. I am using the below code in QT and GCC.
void MainWindow::on_pushButton_2_clicked()
{
CURL *curl;
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");
curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
QT gives me a huge list of errors that I have pasted here. Some of the key errors are tlsthrd.c:-1: error: undefined reference to 'EnterCriticalSection@4'
I am using LIBS += -LC:\MinGW\lib -lcurldll
in my .pro
file to link the project to the curl library. Any idea as to why this is happening? Cheers.
Edit: After a deeper look, it appears as if libmingw32.a
is having some issues providing references to functions used for multi-threading. Should I try and replace the library file? If so, why is GCC compiling correctly with the same library file but QT is not?