Bug#94955: Linking with libstdc++ changes behavior of a program (which does not require libstdc++)
Ben Collins <bcollins@debian.org> writes:
> On Sun, Apr 22, 2001 at 11:31:18PM -0700, Philippe Troin wrote:
> > phil@resume:~% gcc -o foo foo.cpp -lstdc++
>
> IMO, you should use:
>
> % g++ foo foo.cpp
This brings the same result as 'gcc -o foo foo.cpp -lstdc++': crash.
> ...instead. There are a lot more things going on when using g++ other
> than adding -lstdc++.
According to 'gcc -v' the only difference between `g++ -o foo foo.cpp'
and `gcc -o foo foo.cpp' is the two extra libraries `-lstdc++ -lm' at
link time...
> If this works for you, then I suggest closing the bug.
If it were that easy...
As mentionned in the initial bug report, I found this with a much
bigger program that was crashing when throwing complex (instances of
derived classes) exceptions... This program was initially compiled and
linked with g++. This program does not need libstdc++. When I tried to
link it without (with gcc), it started working.
Just adding '-lstdc++' makes exceptions handling buggy... The crash
happens during the throw()... I'm quite puzzled...
Phil.
Reply to: