I use Visual Studio 2010 on Windows 7. I have this function:
void send(char* log, char* pas, char* ser, char* plik)
{
HINTERNET hInternet;
HINTERNET hFtpSession;
hInternet = InternetOpenA(NULL,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
hFtpSession = InternetConnectA(hInternet,ser,INTERNET_DEFAULT_FTP_PORT,log,pas, INTERNET_SERVICE_FTP, 0,0 );
FtpPutFileA(hFtpSession, "WMM.txt", plik, FTP_TRANSFER_TYPE_BINARY, 0);
}
It didn't work:
- error LNK2019: unresolved external symbol "void __cdecl send(class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::basic_string<char,struct std::char_traits,class std::allocator >)" (?send@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@000@Z) referenced in function _main
2)fatal error LNK1120: 1 unresolved externals
I googled for solution and found this:
Add this #pragma comment(lib, "wininet")
to your code or add wininet.lib in your project properties: Linker->Input
I do this and still not working - I get identical errors like earlier. Have you got any idea what I should do for resolved this problem?