About Linking of a simple C++ prog.
Rupert Wood
me@rupey.net
Fri Oct 12 00:51:00 GMT 2001
> I have tried g++ & gcc -lstdc++, it doesn't work either,
> although the error messages is different as follows:
> $PWD$g++ test.cpp
> $PWD$./a.out
> ld.so.1: ./a.out: fatal: libstdc++.so.2.10.0: open failed: No
> such file or directory
> Killed
>
> So what should I do?
Oops. I do know the answer to this one :-) I just didn't read your other
mails properly.
You need to add the location of the c++ runtime library to your
LD_LIBRARY_PATH environment (or create one if you don't have one). If
you built gcc yourself, this will be ${prefix}/lib (by default,
/usr/local/lib). If you installed the sunfreeware package, this will be
/opt/gcc/lib or similar.
Rup.
More information about the Gcc-help
mailing list