[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Linking Question -- Static vs. Dynamic



On Mon, 3 Aug 1998, Fulgham, Brent/SCO wrote:

> Can one of you gurus tell me how to instruct gcc to STATICALLY link one
> particular library, while dynamically linking to all the others?
> 
> I wish to link an application with the static libstdc++.a archive, while
> allowing all other Linux libraries to be linked dynamically.  My
> understanding is that ld will search through the library directories and
> preferentially link with shared libraries over static.  Since I have
> both a static and dynamic version of libstdc++, how do I force ld to
> choose the static archive?  I have already tried putting the archive
> name into the object list of the makefile, which didn't seem to work.
> 
> Help!

a) Wrong forum.  Maybe debian-mentors...

b) Have you tried -l/path/to/libstdc++.a (instead of -lstdc++)?  Of
course, g++ does some auto-linking, and I don't know the details of that
(but 'info gcc/g++' might know...)

Jules

/----------------+-------------------------------+---------------------\
|  Jelibean aka  | jules@jellybean.co.uk         |  6 Evelyn Rd	       |
|  Jules aka     | jules@debian.org              |  Richmond, Surrey   |
|  Julian Bean   | jmlb2@hermes.cam.ac.uk        |  TW9 2TF *UK*       |
+----------------+-------------------------------+---------------------+
|  War doesn't demonstrate who's right... just who's left.             |
|  When privacy is outlawed... only the outlaws have privacy.          |
\----------------------------------------------------------------------/


--  
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: