【发布时间】:2014-04-04 03:45:01
【问题描述】:
#include <iostream>
#include <windows.h>
#include <wininet.h>
#pragma comment(lib, "wininet")
#include <pshpack4.h>
#include <poppack.h>
using namespace std;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HINTERNET hInternet;
HINTERNET hFtpSession;
hInternet = InternetOpen(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
hFtpSession = InternetConnect(hInternet, "ftp.drivehq.com",INTERNET_DEFAULT_FTP_PORT, "usr" ,"pass", INTERNET_SERVICE_FTP, 0, 0);
FtpPutFile(hFtpSession, "log.txt", "mylog.txt", FTP_TRANSFER_TYPE_BINARY, 0);
InternetCloseHandle(hFtpSession);
InternetCloseHandle(hInternet);
return 0;
}
[链接器错误] 未定义对“InternetOpenA@20”的引用
[链接器错误] 未定义对 `InternetConnectA@32' 的引用
[链接器错误] 未定义对“FtpPutFileA@20”的引用
[链接器错误] 未定义对“InternetCloseHandle@4”的引用
[链接器错误] 未定义对“InternetCloseHandle@4”的引用
ld 返回 1 个退出状态
C:\Users\Wade\Desktop\test\command builder\Makefile.win [Build Error] [command.exe] Error 1
我的代码有什么问题,它一直给我链接器错误?
【问题讨论】:
标签: c++ linker-errors wininet