作者:已1注2销 | 来源:互联网 | 2024-09-25 09:07
ImnewwithWinInetandhavefollowingsimpleC++code:我是WinInet的新手,有以下简单的c++代码:voidDoIt(std::s
I'm new with WinInet and have following simple C++ code:
我是WinInet的新手,有以下简单的c++代码:
void DoIt(std::string& host, std::string& username, std::string& password) {
HINTERNET hInternet;
HINTERNET hFtpSession;
hInternet = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
if (hInternet == NULL) {
std::cout <<"Error: " <
But compiler's output is:
但是编译器的输出是:
Info: Configuration "Debug" uses tool-chain "MinGW GCC" that is unsupported on this system, attempting to build anyway.
Info: Internal Builder is used for build
g++ -O0 -g3 -Wall -std=c++11 -o main.o "..\\main.cpp"
C:\Users\u007\AppData\Local\Temp\ccFEaWlK.o: In function `Z4DoItRSsS_S_':
C:\projects\ftp-test\Debug/../main.cpp:10: undefined reference to `_imp__InternetOpenA@20'
C:\projects\ftp-test\Debug/../main.cpp:14: undefined reference to `_imp__InternetConnectA@32'
C:\projects\ftp-test\Debug/../main.cpp:18: undefined reference to `_imp__FtpPutFileA@20'
collect2.exe: error: ld returned 1 exit status
(I link to wininet.lib
library in Eclipse's linker)
(我经由wininet链接。Eclipse的链接库中的lib库)
(I also tried to add -lwininet
option to compiler but it does nothing)
(我还尝试向编译器添加-lwininet选项,但它什么也不做)
I use following software:
我使用以下软件:
- OS:
Windows 10 x64
- 操作系统:Windows 10 x64
- IDE:
Eclipse Neon 3
- Eclipse IDE:霓虹灯3
- Compiler:
MinGW (rubenvb-4.8-stdthread) 4.8.1 20130324 (prerelease)
- 编译器:MinGW (rubenvb-4.8-stdthread) 4.8.1 20130324 (prerelease)
I saw following links: 1 2 3 but nothing there helps me.
我看到了以下链接:1 2 3,但没有任何帮助。
Thanks for any suggestion.
谢谢你的建议。
1 个解决方案