public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* probably an old question about overriding hardcoded library search paths
@ 2012-11-11 14:46 Charles Smith
  2012-11-11 14:52 ` Marc Glisse
  0 siblings, 1 reply; 9+ messages in thread
From: Charles Smith @ 2012-11-11 14:46 UTC (permalink / raw)
  To: gcc-help

How can I force a private copy of sqlite3 to be linked to my
application?

My ubuntu 10.04 system has sqlite3 in /usr/local/lib and /usr/lib.
I want to link my application with a private version of sqlite3.
Using -L and -l doesn't work because the additional directory is
"appended" to the search path.  The g++ compiler always links with
/usr/local/lib or (if I move that out of the way) /usr/lib.  When I
move both out of the way, the application links successfully.  But
then, the system is useless for most other uses.

Under "3.13 Options for Linking", the gcc manual lists these options.
An excerpt of the result is shown for both.


-nostdlib
    ./flat/layer_mgmt.o: In function `__static_initialization_and_destruction_0':
/usr/include/c++/4.4/iostream:72: undefined reference to `__dso_handle'


-nodefaultlibs
    ...
    /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 22 has invalid symbol index 22




Interestingly "g++ -print-search-dirs" does not show /usr/local/lib.

install: /usr/lib/gcc/i486-linux-gnu/4.4.3/
programs: =/usr/lib/gcc/i486-linux-gnu/4.4.3/:/usr/lib/gcc/i486-linux-gnu/4.4.3/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.4.3/:/usr/lib/gcc/i486-linux-gnu/:/usr/libexec/gcc/i486-linux-gnu/4.4.3/:/usr/libexec/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.4.3/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/bin/i486-linux-gnu/4.4.3/:/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/bin/
libraries: =/usr/lib/gcc/i486-linux-gnu/4.4.3/:/usr/lib/gcc/i486-linux-gnu/4.4.3/:/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.4.3/:/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/../lib/:/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../i486-linux-gnu/4.4.3/:/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/:/lib/i486-linux-gnu/4.4.3/:/lib/../lib/:/usr/lib/i486-linux-gnu/4.4.3/:/usr/lib/../lib/:/usr/lib/i486-linux-gnu/i486-linux-gnu/4.4.3/:/usr/lib/i486-linux-gnu/../lib/:/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../i486-linux-gnu/lib/:/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../:/lib/:/usr/lib/:/usr/lib/i486-linux-gnu/

Is there a way to do this other than understanding the internal architecture of the gcc installation?

TIA

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-11-11 21:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-11 14:46 probably an old question about overriding hardcoded library search paths Charles Smith
2012-11-11 14:52 ` Marc Glisse
2012-11-11 15:12   ` Charles Smith
2012-11-11 16:24     ` Jonathan Wakely
2012-11-11 20:27   ` Charles Smith
2012-11-11 20:29     ` Jonathan Wakely
2012-11-11 20:30     ` Marc Glisse
2012-11-11 20:41       ` Charles Smith
2012-11-11 21:02         ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).