Anyway I don't know if is it possible to statically link only some
libraries and moreover I even don't know how to find out which are the
dependencies of a dynamic linked executable under mac os x: ldd seems
not to be available.

To find out the dependencies you can use otool, like this:


otool -L libfoo.dylib


As for the statical linking: I'm no expert in this, but I would say that when you want to link something statically, you just name the object file when you're doing the linking step in gcc. For instance:


gcc -o theprogram theprogram.o /sw/lib/libfoo.a /sw/lib/libbar.a <any other libs>


If on the other hand you want to link something dynamically, you use the flags -L and -l, such as:


gcc -o theprogram theprogram.o -L/sw/lib -lfoo -lbar

(-L tells gcc where to look for the dynamic linked libraries foo and bar. You can use -L multiple times, exactly as you would do with -I, if you want to link against libraries that reside in multiple locations)


Of course, you can mix both linking variants, so this would accomplish what you want ("statically link only some libraries"):


gcc -o theprogram theprogram.o -L/sw/lib -lfoo /sw/lib/libfoo.a



Everybody correct me if I just told something stupid :-)

Hope this helps
Patrick



----------------------------------------------------------------------
Patrick Naef                "The Queen of Hearts, she made some tarts,
Lucerne, Switzerland                              All on a summer day:
[EMAIL PROTECTED]        The Knave of Hearts, he stole those tarts,
PGP public key:                             And took them quite away!"
http://www.herzbube.ch/Misc/PGPHerzbubeAtHerzbubeDotCH.txt



-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Fink-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to