I've been attempting to do some network programming in c++ but I'm having trouble getting started. So you know where I'm coming from, I'm fairly familiar with network programming with python where the only set up for network programming is putting 'include sockets' at the top of the file. It seems to be a little more complicated in c++.
The set up I have right now is MinGW installed on windows 7 64-bit. I also have Cygwin installed, but I'm not very sure how to use it.
nettest.cpp:11:49: error: 'inet_pton' was not declared in this scope
Clearly something isn't being setup correctly but I don't know what. I tried googling the error but I can't seem to find anyone with a similar problem.
I think you're right. I found the inet.h file in the cygwin directory but it can't seem to include the files it needs correctly.
I can include inet.h fine. But inet.h needs to include in.h which is in the netinet directory. I've tried moving the inet.h file to many different directories but it still can't find the in.h file.
I also tried editing the inet.h file to make it include the in.h file using absolute referencing but then I get this error which is similar except for the last part:
1 2 3 4
In file included from C:\cygwin\usr\include\arpa\inet.h:14:0,
from nettest.cpp:3:
C:/cygwin/usr/include/netinet/in.h:14:23: fatal error: cygwin/in.h: No such file
or directory
The difference there is that it says "cygwin/in.h" but that's not where the file is. It's in C:/cygwin/usr/include/netinet/ and that's where I said to include to.
Edit: I realized that the error is coming from the in.h file. I looked in the in.h file and found "#ifndef _CYGWIN_IN_H" to be the source of the error but I have no idea how to fix that.
@kbw I still get the same error( inet_pton undeclared). Like you said, it isn't standardized and I definitely don't know enough to figure what it is at the moment. I wanted to just use winsock but for now I might try some other library. Thanks anyway.