Learning C programming problem

Paul Civati paul at xciv.org
Thu Jan 25 15:16:05 GMT 2001


Simon,

> 	gcc -g -o test
> test.c -L/usr/local/lib/mysql -I/usr/local/include/mysql -lmysqlclient -lsoc
> ket -lnsl
> 
> We get
> 	/usr/libexec/elf/ld: cannot open -lsocket: No such file or directory

The 'socket' and 'nsl' libs are typically needed when compiling under
Solaris, thus you shouldn't need them.

> Being completely new to this stuff we read some man pages and found that the
> file should be called libsocket.a but can't locate it anywhere on our

The socket and name server libraries are part of the libc on
{Free,Net,Open}BSD so you should be able to remove the '-l' libary
references.

> server.  Being as the server was never built with C programming in mind it
> is perfectly likely that this file (and libnsl.a) are missing.
> 
> So, the question is - where can I install these files from?

No need.

-Paul-




More information about the Ukfreebsd mailing list