i have this prob;em with FTP

Write your question here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<windows.h>
#include<Wininet.h>



int main()
{
    HINTERNET hInternet;
    HINTERNET hFtp;
    InternetOpen(0,INTERNET_OPEN_TYPE_DIRECT,0,0,0);
    hFtp = InternetConnect(hInternet,"ftp.luxarhosting.be",INTERNET_DEFAULT_FTP_PORT,"username","mypass",INTERNET_SERVICE_FTP,0,0);
    char szFile[] = "log.txt";
    char szFilePath[MAX_PATH];
    unsigned long ulPathSize = GetFullPathName(szFile,MAX_PATH,szFilePath,0);
    szFilePath[ulPathSize] = '\0';
    FtpPutFile(hFtp,szFile,"test.txt",INTERNET_FLAG_TRANSFER_BINARY,0);

    InternetCloseHandle(hFtp);
    InternetCloseHandle(hInternet);
    return 0;

}


C:\Users\Mt\Desktop\testing\OnlyFTP.cpp||In function 'int main()':|
C:\Users\Mt\Desktop\testing\OnlyFTP.cpp|13|warning: 'hInternet' may be used uninitialized in this function [-Wuninitialized]|
obj\Debug\OnlyFTP.o||In function `main':|
C:\Users\Mt\Desktop\testing\OnlyFTP.cpp|12|undefined reference to `InternetOpenA@20'|
C:\Users\Mt\Desktop\testing\OnlyFTP.cpp|13|undefined reference to `InternetConnectA@32'|
C:\Users\Mt\Desktop\testing\OnlyFTP.cpp|18|undefined reference to `FtpPutFileA@20'|
C:\Users\Mt\Desktop\testing\OnlyFTP.cpp|20|undefined reference to `InternetCloseHandle@4'|
C:\Users\Mt\Desktop\testing\OnlyFTP.cpp|21|undefined reference to `InternetCloseHandle@4'|
||=== Build finished: 5 errors, 1 warnings (0 minutes, 1 seconds) ===|


i get this error .. what should i do ?
im compile this code with code blocks .. empty project
and sorry for my poor english ..
i trying to upload a file to my FTP server :)
thanks ..
Topic archived. No new replies allowed.