-   Linux - Newbie (
-   -   /usr/bin/ld: cannot find -lsocket (

thodori 06-17-2012 05:03 PM

/usr/bin/ld: cannot find -lsocket
Hi, my name is Ted and I am very much a Linux newbie. Taking a Computer Networking course and am getting /usr/bin/ld: cannot find -lsocket, when I compile. Any input would be appreciated.

knudfl 06-17-2012 06:28 PM

Welcome to LQ.

'lsocket' = or libsocket.a
... Which software are you compiling ? ?

Packages containing libsocket.* , examples :
camsource, libcamsource*, libferris-context_sockets, pfe-forth-devel, ctrlproxy. > Search > Advanced Search :


thodori 06-18-2012 02:32 PM

I compiling on my universities unix system using:
gcc -o tcpc tcpc.c -lnsl -lsocket

knudfl 06-18-2012 04:11 PM

The libraries "", "libnsl.a" are provided by the main library = libc.
The development package must be installed. (glibc-devel ? libc6-dev ?).

Ask somebody at the university, which "Unix OS" you are using.
Name and version.

Also : It is impossible to guess which libsocket.* it is about.
Please do a search :
Include all OS, all versions to decide the required library.


All times are GMT -5. The time now is 03:17 PM.