I'm developing a generic unix console application. It is linked to a few
libraries including postgresql's libpq.
When I check shared libraries my application uses with otools -L, it doesn't
list libpq. Looked like it is linked with static library. so i checked if
dylib file exist in pgsql's lib directory and found no dylib file but .so
file. file command says it is a Mach-O bundle file. I have no knowledge
regarding Mach-O bundle file.
How do you link bundle files into your application using commandline tools? My
application is not Xcode project but just a Makefile project.
Thanks.
--
Y. J. Chun
> When I check shared libraries my application uses with otools -L, it
> doesn't list libpq. Looked like it is linked with static library. so
> i checked if dylib file exist in pgsql's lib directory and found no
> dylib file but .so file. file command says it is a Mach-O bundle
> file. I have no knowledge regarding Mach-O bundle file.
To have used the .so extension for shared object files would have been
an act of not thinking sufficiently different.
You can turn libpq.a into libpq.dylib as follows:
% libtool -dynamic -o libpq.dylib libpq.a -lSystem
This produces a file called libpq.dylib in the same directory as
libpq.a. If you recompile your program, it should then be linked with
the new dynamic library. If not, you can give the -dynamic flag to
gcc. To successfully run the program, you will also need to make the
library accessible to dyld(1), e.g. by setting the DYLD_LIBRARY_PATH
environment variable.
"Y. J. Chun" <NO_y...@mac.com_SPAM> writes:
> i checked if dylib file exist in pgsql's lib directory and found no
> dylib file but .so file. file command says it is a Mach-O bundle
> file. I have no knowledge regarding Mach-O bundle file.
A name doesn't say much about a file type, but the linker expects a
specific naming convention.
I just recently read the Fink porting notes about this topic and found
them interesting <http://fink.sourceforge.net/doc/porting/shared.php>.
benny