PDA

View Full Version : BSD libs on Mac OS X



brahms
August 1st, 2003, 10:29 AM
Does anyone know where to locate some of the basic BSD libs for OS X? I'm trying to run make on some source but it requires libsocket.dynlib and libnsl.dynlib. Anyone know where we can get a version that works on OS X?

anarchie
August 1st, 2003, 03:03 PM
I'm quite sure that both of those libraries are part of libc on OS X. Thus, you don't need to link in any extra libraries to use sockets or NSL. You could either modify the makefiles so they do not require those libraries, or create dummy libraries only so that the linker finds them.

brahms
August 4th, 2003, 08:20 AM
Thanks so much for the response. I modified the makefile so that it didn't try to link in the extra libraries, just the libc and libm. Unfortunately now I get an error from ld saying that _ftime is an undefined symbol. I'm going to look into that a little more. Thanks again for your response.

anarchie
August 4th, 2003, 03:07 PM
From the ftime(3) manpage:


This interface is obsoleted by gettimeofday(2). It is available from the
compatibility library, libcompat.


You'll have to link in libcompat.

brahms
August 6th, 2003, 11:31 AM
Couldn't fine libcompat, but it wasn't ftime that was failing, it was _ftime. I found that method in libcrypto. After linking that in everything ran smoothly. Thanks for the help all.

anarchie
August 6th, 2003, 02:27 PM
Just for the record, a symbol is formed by prefixing a C function with an underscore. So yes, the symbol _ftime corresponds to the C function ftime. I checked, and the documentation on ftime IS inconsistent - libcompat isn't on OS X. So, uh, for all of you who need ftime, it's in libcrypto. =O