Learning C programming problem

Mark Blackman mark.blackman at netscalibur.co.uk
Thu Jan 25 15:18:30 GMT 2001

I might be wrong but -lsocket and -lnsl look like sysV-isms 
and maybe only linux-isms. Don't think either are necessary on 
BSD. I await corrections.

- Mark 

> We are playing around with C in our office and have copied one of the mysql
> examples from the O'Reilly book but when we try and compile it with
> 	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
> 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
> 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?
> Thanks in advance for any help
> Simon Clayton
> Reference Technology Ltd
> ------ FreeBSD UK Users' Group  -  Mailing List ------
> http://listserver.uk.freebsd.org/mailman/listinfo/freebsd-users

More information about the Ukfreebsd mailing list