The.Anti.9
The.Anti.9

Reputation: 44648

VS2008 Missing C/C++ Header Files

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

Answers (4)

Jason Coco
Jason Coco

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

Alex B
Alex B

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

user36457
user36457

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

Evan Teran
Evan Teran

Reputation: 90422

none of those are standard c or c++ headers. On windows, socket definitions are in winsock2.h

Upvotes: 4

Related Questions