This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++.so.3 not found
- To: gcc-bugs at gcc dot gnu dot org
- Subject: libstdc++.so.3 not found
- From: Al Stevens <astevens at ddj dot com>
- Date: Thu, 21 Jun 2001 13:35:37 -0400
- Reply-To: astevens at ddj dot com
I'm not sure this is the correct list for this report, because I'm not sure
whether it identifies a bug or deficiencies in the installation procedures.
1. Downloaded and installed gcc 3.0. Used the --prefix option to install it
in /usr/local/gcc30.
2. This is a Red Hat 7.1 distribution, which means that gcc 2.96 (ugh!) is
installed in /usr. kgcc (egcs-2.91.66) is also installed somewhere.
3. Installation went without problems. (I ran it as root, although I don't
know if that is necessary. The installation procedures do not specify. After
make install I logged in as a regular user.)
4. gcc --version revealed that 2.96 is still the default.
5. Put /usr/local/gcc30/bin at the front of PATH. Shouldn't install take care
of that?
6. Compiled simple hello world C++ program.
gcc -o tester tester.cpp -lstdc++
7. Got error message saying libgcc_s.so.1 could not be found. I'm wondering
why it needs a shared object library. I thought my command specified a static
link to libstdc++.a. Oh, well.
8. LD_LIBRARY_PATH=/usr/lib. Shouldn't install have fixed this? Can anyone
tell me what script or conf file initially sets this environment variable? I
haven't found it yet.
9. Added /usr/local/gcc30/lib: to front of LD_LIBRARY_PATH.
10. Program compiles and runs now.
(I also tried an alternative approach: putting the path in /etc/ld.co.conf
and running ldconfig without changing the environment variable. That works,
too.)
I suspect your installation procedures assume we know more than we do.
Old-timers and testers probably don't have these problems because they know
the extra steps needed to get the compiler to work.
I recompiled the program with -v to see what's happening. The linker
(collect2) is getting a shared library from /lib and what looks like startup
code from /usr/lib, which worries me:. From the linker command:
/lib/ld-linux.so.2
/usr/lib/crt1.o
/usr/lib/crti.o
These files have older dates suggesting that they belong to the older gcc. Or
are they just generic startup code modules for all language translators? I
don't find similarly-named files anywhere in the gcc 3.0 distribution.
Al Stevens
Dr. Dobb's Journal