Reputation: 44648
So, I'm working on some network programming in C, and it would seem that I am missing a bunch of standard C/C++ header files. For example, sys/socket.h
is not there. A few otheres are missing too like netdb.h
, and unistd.h
. Is there a pack I need to install to get these on windows?
Thanks
Upvotes: 2
Views: 3480
Reputation: 78353
As others said, you're using the POSIX headers and definitions for Socket. Check out MSDN for the headers and structures that are defined on Windows: http://msdn.microsoft.com/en-us/library/ms740506.aspx. The calls are pretty much the same, but this will give you all the microsoft-specific syntax.
Upvotes: 1
Reputation: 84812
All these headers are from POSIX, not ANSI C, or ISO C++. You won't find them in Windows without installing some sort of compatibility layer, like Cygwin, or porting your application to Windows API, or use some macros and wrappers to map similar functions (i.e. #define strtok_r strtok_s
).
Upvotes: 4
Reputation:
you probably won't find it because it is a commonly used linux header file. You can find it in linux-libc-dev, if you really want it.
Upvotes: 1
Reputation: 90422
none of those are standard c or c++ headers. On windows, socket definitions are in winsock2.h
Upvotes: 4