Mihail Mihaylov wrote:
> Hi,
>
> I am trying to compile a C++ program under Linux 2.0.34 using g++. In
> that program I include <socket.h> and <pthread.h> and because of that I
Isn't that include <sys/socket.h> ?
>
> compile with -lsocket (for the socket library to be included) and -lthread
I don't have any libsocket on my debian.
If you look at the man pages you'll find that the socket calls
connect, recv ... are kernel calls ( or the libc texinfo documentation)
In fact a socket is just a file descriptor, and so can be treated as a it
( eg you can use read/write on a socket)
>
> (for the Posix thread library to be included). My linker ld,
> complains that it can not find the -lsocket file ?!? ; it does say nothing
> about the -lthread, but the compiler warns me that all the
> functions from this library are "implicitly declared" which to me means
> that the corresponding library *.o file was never found.
>
To me "implicitly declared" means that you didn't include the right
files ( or forget to declare a function) : When the compiler see
function that hasn't been already declared, it declares it by itself
and put a warning.
>
> The above program compiles and runs fine under SunOs, but not under
> Linux. I have attached the Makefile that I am using.
>
I don't know solaris, but i believe after reading your mail
that include files and libraries are not the same on both systems.
>
> Any help would be greatly appreciated,
> mich
>
Hope this helps
--
david Ramboz