4

Im pretty new to c++ programming so bear with me . I'm trying to create a ftp client for educational purposes, Did some research and decided to give Wininet a try and came across some online tutorials :

Take this as an example:

#include <windows.h>
#include <wininet.h>

Note that there is no error checking or what so ever , this is just sample code.

int main(){

HINTERNET hInternet = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);

HINTERNET hFtpSession = InternetConnect(hInternet, "server", INTERNET_DEFAULT_FTP_PORT, "user", "pass", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);  

...


InternetCloseHandle(hInternet); 

}

while writing this my ide(Vs2017) tells me "identifier internetOpenW is undefined". And the same with "InternetConnect". I've been looking for a solution all over, with no succes ! I would appreciate any help , as i have nowhere else to turn to !

excuse my bad english !

KonstantinL
  • 667
  • 1
  • 8
  • 20

1 Answers1

5

MSDN

Add "wininet.lib" here: Project Properties -> Linker -> Input -> Additional Dependencies

Don't forget to specify "wininet.lib" for both build configurations (Debug and Release).

KonstantinL
  • 667
  • 1
  • 8
  • 20
  • Thanks for replying so quickly ! i was able to figure it out . Next time i should take more time reading instead of asking ! i appreciate your reply regardlessly . – Yoni Blauer Dec 07 '17 at 15:15