I am trying to cross-compile simple C++ program for Windows using libcurl and Linux.
(我正在尝试使用libcurl和Linux对Windows的简单C ++程序进行交叉编译。)
I am using the following code: (我正在使用以下代码:)
x86_64-w64-mingw32-g++ -DCURL_STATICLIB curl_example.cpp -oe -lcurl
However, I get the following error:
(但是,出现以下错误:)
/usr/bin/x86_64-w64-mingw32-ld: /tmp/ccNXyMyw.o:curl_example.cpp:(.text+0xa5): undefined reference to `curl_easy_setopt'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/ccNXyMyw.o:curl_example.cpp:(.text+0xbd): undefined reference to `curl_easy_setopt'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/ccNXyMyw.o:curl_example.cpp:(.text+0xc9): undefined reference to `curl_easy_perform'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/ccNXyMyw.o:curl_example.cpp:(.text+0xd8): undefined reference to `curl_easy_cleanup'
collect2: error: ld returned 1 exit status
I include curl like this: #include <curl/curl.h>
(我包含如下所示的curl: #include <curl/curl.h>
)
And I've tried every suggested solution to the problem I could find.
(我已经尝试了所有可以找到的问题的建议解决方案。)
Also I have to note, that if I use g++, it works fine: (我还要注意,如果我使用g ++,它可以正常工作:)
g++ -DCURL_STATICLIB curl_example.cpp -oe -lcurl
What could be the issue?
(可能是什么问题?)
ask by e.e translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…