4
votes

Where can i download the following header files for dev c

sys/types.h sys/socket.h netinet/in.h arpa/inet.h

and also the structure

sockadder and it's derivatives?

5
For which implementation? Linux, MSVC, FreeBSD, Solaris all have their own version...thkala
Looks like you are studying Unix socket programming. These are part of Berkeley sockets if I remember correctly. Don't know where you'll get them. In Linux, should be part of some package. No idea about Windows.Madhur Ahuja
If you are on a *nix machine they probably live under /usr/include/nategoose

5 Answers

5
votes

I don't know why you need to download these specific files, since they should come with your compiler suite in most modern systems.

You should also keep in mind that they can be radically different depending on your platform and that those files often #include other non-standard files (which #include others and so on). This could make those files very hard to parse and understand.

That said, from some indeterminate version of Linux:

http://linux.die.net/include/sys/types.h

http://linux.die.net/include/sys/socket.h

http://linux.die.net/include/netinet/in.h

http://linux.die.net/include/arpa/inet.h

If you are going to replace missing files, consider getting/reinstalling a proper compiler suite and any developer packages your are missing.

If you want to look at the structure definitions you should definitely be looking at the documentation rather than the actual implementations. That way you avoid tying your code to private definitions e.t.c. that can change between systems.

EDIT:

Just to confirm some of my comments above, struct sockaddr for said version of Linux is defined piece-by-piece in:

http://linux.die.net/include/bits/socket.h

http://linux.die.net/include/bits/sockaddr.h

1
votes

What SDK are you working with? For Linux you get these files as part of your core C sdk. For Windows it comes with the SDK as well. If you just want a quick and dirty look at some header files I use http://www.google.com/codesearch.

0
votes

Those headers (not header files) are part of the implementation. They need not be real files.

If your implementation does not provide them, you're out of luck.

If your implementation provides them as real files and you deleted them, reinstalling the compiler might work.

If your implementation provides them as real files and you cannot reinstall the compiler your approach might work. Sorry, I have no idea where to download the files --- or why would anyone copy the files somewhere in the first place.

0
votes

I'm assuming that you are trying to compile a source code for the *nix platform under another, such as Windows. This approach won't do you any good. Remember that you'll need the libraries of those headers and they are not portable.

Install a Virtual Machine with Ubuntu on your PC to do this kind of development.

-1
votes
do:
apt-get install gcc-4.2