g++ linking problems (stdlibc++)
Claudio Bley
bley@cs.uni-magdeburg.de
Sun Apr 14 21:22:00 GMT 2002
>>>>> "Oliver" == Oliver Kullmann <O.Kullmann@swansea.ac.uk> writes:
Oliver> I'm running Suse Linux 7.3 with gcc version 2.95.3. Since
Oliver> this version of g++ has quite a few drawbacks (many errors
Oliver> are not detected, compiler errors w.r.t. iterator traits,
Oliver> ...), I had to upgrade to gcc version 3.0.4.
Oliver> Now the problem is, even the Hello-World program does not
Oliver> run:
>> /usr/local/bin/g++ Hello.cpp a.out
Oliver> a.out: error while loading shared libraries:
Oliver> libstdc++.so.3: cannot open shared object file: No such
Oliver> file or directory
Oliver> I had no such problems with the old version of g++. In
Oliver> /usr/local/lib we have libstdc++.so.3, and /usr/local/lib
Oliver> is in the LD-path. Just to give it a try:
>> g++ -L/usr/local/lib -lstdc++ Hello.cpp
Oliver> does not yield a running program neither. The
Oliver> ld-configuration seems ok to me:
Try to run the program under strace and see where it looks for the
libraries. (e.g. 'strace -e open <your-program> <program-args>').
(did you run a ldconfig after installing gcc?)
Oliver> The second ugly problem with g++ is, that .o-files
Oliver> produced by g++ seem to be incompatible with .o-files or
Oliver> libraries produced with older versions of g++. This would
Oliver> be a disaster, and I can't believe that.
The C++ ABI has changed; C++ object files are indeed incompatible
between GCC 2.x and 3.x.
HTH
Claudio
More information about the Gcc-help
mailing list