问题
System Windows 7 64bit, Eclipse Mars + CDT, MinGW 64, curl source https://curl.haxx.se/download.html for Win64 - MinGW64 SSH SSL, have tried other versions with very same linker errors Code:
#include <curl/curl.h>
int main(void) {
CURL * curl;
curl = curl_easy_init();
if (curl) {
curl_easy_cleanup(curl);
}
return 0;
}
The problem with linker errors:
Info: Internal Builder is used for build
g++ -DCURL_STATICLIB "-IC:\\Source\\curl-7.40.0-devel-mingw64\\include" "-IC:\\Source\\curl-7.40.0-devel-mingw64\\include\\curl" -O0 -g3 -Wall -c -fmessage-length=0 -o main.o "..\\main.cpp"
g++ -static -Wl,-Map,output.map -o xmlServiceCall.exe main.o -lcurl "-LC:\\Source\\curl-7.40.0-devel-mingw64\\lib64"
main.o: In function `main':
C:\workspace_mars_cpp\xmlServiceCall\Debug/../main.cpp:8: undefined reference to `curl_easy_init'
C:\workspace_mars_cpp\xmlServiceCall\Debug/../main.cpp:25: undefined reference to `curl_easy_cleanup'
collect2.exe: error: ld returned 1 exit status
14:14:56 Build Finished (took 848ms)
Have read dozens of similar questions here, and also on other internets, but they all suggest change linking order or add paths which doesn't help. Where else could I dig to solve this problem?
来源:https://stackoverflow.com/questions/37678150/undefined-reference-to-curl-easy-init