Hi,
I'm trying to launch the code from Beej's "Guide to Network Programming".
I tried to google, but I didn't find a solution. Other people were able to fix SIMILAR problems with adding some header files or a lib, but it didn't work for me.
The code looks like this(there are unnecessary headers, I know, but they are added just to rule out the possible header issue :redface:) :
Now I get inet_ntop undeclared(first use this in function).Now I get inet_ntop undeclared(first use this in function).Code:
#include <iostream>
#include <winsock2.h>
#include <windows.h>
#include <Ws2tcpip.h>
int main(int argc, char *argv[])
{
WSACleanup();
return 0;
}
I've tried to replace it with inetNtop, and PCTSTR WSAAPI InetNtop. I still get the same thing.
I've added 'libws2_32.a' and 'libsock32.a' under project->project options->parameters->add library or object in Dev-C++.
I know the InetNtop should be avoided in the first place, but I'm trying to understand network programming before I start with the alternatives.
Any idea whats wrong?