This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Dynamic linker is unable to find GCC libraries
- To: bug-gcc at gnu dot org
- Subject: Dynamic linker is unable to find GCC libraries
- From: Benoit Hudson <bhudson at ptolemy dot arc dot nasa dot gov>
- Date: Wed, 5 Jul 2000 14:45:33 -0700
My particular problem is with libstdc++. If my LD_LIBRARY_PATH isn't set
to include $(libdir), I can compile and link, but not run.
Now, I know that law@cygnus.com has a response to this very question in the
FAQ. But his answer:
we don't pass -R to the linker because your program might hang even
if it isn't using the library.
Is easily refuted by:
every C++ program uses libstdc++.
I've fixed the problem in my personal installation by making g++ be a
script (and c++ is a symlink to g++)
#! /bin/sh
exec real-g++ "$@" -R $(libdir)
I'd have to write about the same, but -rpath, on my linux box.
So it's easy to fix, but it shouldn't be the user's responsibility.
-- Benoit