Undefined reference to curl_easy_init

▼魔方 西西 提交于 2019-12-12 02:38:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!