I was doing a project in which i needed to make HTTP request to access webpages,make downloads etc.. So i decided to use Curl.
I downloaded curl-7.39.0-devel-mingw64.7z and extracted it and added the libraries, bin, and includes to mingw.
I am using Netbeans IDE. So i added -lcurl in project properties->linkers->additional options
but now i get the following errors.
g++ -o dist/Debug/MinGW-Windows/app build/Debug/MinGW-Windows/mainConnector.o -lcurl build/Debug/MinGW-Windows/mainConnector.o: In function `Z9connectorv':
C:\Users\0xuser\Documents\NetBeansProjects\app/mainConnector.cpp:8: undefined reference to `_imp__curl_global_init'
.
.(some more similar errors)
.
collect2.exe: error: ld returned 1 exit status
I linked the library correctly right. Then why is this showing up?
Note: I Googled about this and found about linking curl library by adding -lcurl but its not working for me. On my research i understood linking is a common problem for a newbie and even on stackoverflow.com we have similar questions(Oh yeah i readed these https://stackoverflow.com/questions/7604889/mingw32-curl-on-windows-7-error-undefined-reference-to-imp-curl-global-init ). But they only answer upto adding the -lcurl. They don't say about the possibilities for that to fail as in my case.