I compile my simple prog with #include <sys/socket.h>
but there's none of this file.
Where is it, I just start coding in linux and I have no idea where is it . Or do we need to download it online .
views:
67answers:
4
+10
A:
In case you have installed manual pages, the first stop should be man socket
.
Without manual pages you could call
find /usr/include -name socket.h
which outputs
/usr/include/asm/socket.h
/usr/include/sys/socket.h
/usr/include/bits/socket.h
/usr/include/linux/socket.h
on my system, the one to include is sys/socket.h
.
Also see the Single UNIX Specification.
Peter G.
2010-10-26 11:54:09
thanks there's another place, the find tool and include folder is useful :)
nXqd
2010-10-26 11:59:11
+1 for teaching how to find it
Default
2010-10-26 11:59:55
A:
It should be #include <sys/socket.h>
. You may also need to include sys/types.h
.
But if that's failing, can you give a short snippet of source, including what files you're #include'ing and how, and what error message(s) you're getting?
Chris J
2010-10-26 11:56:32