This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

g++ linking problems (stdlibc++)


Hi,

for one week I'm wrestling with compiler problems, but I can't solve them, and
I would be glad if anybody out there could help me a bit.

I'm running Suse Linux 7.3 with gcc version 2.95.3. Since this version of g++
has quite a few drawbacks (many errors are not detected, compiler errors w.r.t.
iterator traits, ...), I had to upgrade to gcc version 3.0.4.

Installation seemed to work alright, using the default installation directory
/usr/local. I did the full and native installation (took over an hour), and got

# /usr/local/bin/g++ -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.4/specs
Configured with: /home/kullmann/csoliver/GCC/gcc-3.0.4/configure
Thread model: single
gcc version 3.0.4

and

> /usr/local/bin/i686-pc-linux-gnu-g++ -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.4/specs
Configured with: /home/kullmann/csoliver/GCC/gcc-3.0.4/configure
Thread model: single
gcc version 3.0.4

(I guess these two are the same (?).)

Now the problem is, even the Hello-World program does not run:

> /usr/local/bin/g++ Hello.cpp
> a.out
a.out: error while loading shared libraries: libstdc++.so.3: cannot open shared
object file: No such file or directory

I had no such problems with the old version of g++. In /usr/local/lib we have libstdc++.so.3,
and /usr/local/lib is in the LD-path. Just to give it a try:

> g++ -L/usr/local/lib -lstdc++ Hello.cpp

does not yield a running program neither. The ld-configuration seems ok to me:

/etc/ld.so.conf :

/lib-aout
/usr/X11R6/lib/Xaw95
/usr/X11R6/lib/Xaw3d
/usr/X11R6/lib
/usr/i486-linux/lib
/usr/i486-linux-libc5/lib=libc5
/usr/i486-linux-libc6/lib=libc6
/usr/i486-linuxaout/lib
/usr/i386-suse-linux/lib
/usr/local/lib
/usr/openwin/lib
/opt/kde/lib
/opt/kde2/lib
/opt/gnome/lib

What's wrong??

Using the -static option I get a running program in the above case, but I guess that this should not
be necessary. By the way, with gcc there seem to be no problems.

The second ugly problem with g++ is, that .o-files produced by g++ seem to be incompatible
with .o-files or libraries produced with older versions of g++. This would be a disaster,
and I can't believe that. I guess it's the same old linking problem.

It seems to me, that the build had problems with libstdc++. For example in

/home/kullmann/csoliver/GCC/Imp_gcc-3.0.4/i686-pc-linux-gnu/libstdc++-v3

we have the file

stamp-sanity-warned

which looks like a warning to me (?), and in the same directory in the file config.status
there are quite a few failed compilations (?). But I don't know the meaning of these things.

I would be really glad for any help!!

Oliver


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]