gcc -o theprogram theprogram.o -L/sw/lib -lfoo /sw/lib/libfoo.a
I'm wondering if this work, I suppose that you should put the "libfoo.a"
before the "-lfoo" switch ... am I wrong? I was just trying what you
proposed but it seems not to work, or at least the dependency on libfoo
remains.
Since you already solved your problem, this is just for the record (and for my own curiosity)...
Of course, I have made a typo - my example line should have read like this to demonstrate the use of two separate libraries:
gcc -o theprogram theprogram.o -L/sw/lib -lbar /sw/lib/libfoo.a
I just tried this with a small "hello world" C app, and it works as I expected. On an aside note: I had to really ***use*** a function from the library that I wanted to statically link against, or gcc would be smart enough to detect my fraud and not do the link at all. The dynamic linking, on the other hand, is done even if my program doesn't use anything from the library.
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
