This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Exception Handling switch gives linking problems
- From: nirav dot dalal at teradyne dot com
- To: Danny Smith <dannysmith at users dot sourceforge dot net>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 11 Mar 2004 13:20:50 -0500
- Subject: RE: Exception Handling switch gives linking problems
Thanks Danny,
That just worked for me :))
- Nirav
Danny Smith
<dannysmith@clea To: gcc-help@gcc.gnu.org
r.net.nz> cc: nirav.dalal@teradyne.com
Subject: RE: Exception Handling switch gives linking problems
03/08/2004 09:04
PM
Please respond
to Danny Smith
From: nirav dot dalal at teradyne dot com
------------------------------------------------------------------------
--------
> Hi,
>
> I'm having issues with GCC compiling & linking when I remove "
> -fno-exceptions"
> switches/option with x86 target.
>
> For example:
>
> Case A] This example works fine.
> >gcc -mdll -DBUILD_DLL -O3 -c -fno-exceptions foo.cpp
> >dllwrap --dllname=foo.dll foo.o
>
> Case B] This example compiles OK, but does NOT link.
> >gcc -mdll -DBUILD_DLL -O3 -c foo.cpp
> >dllwrap --dllname=foo.dll foo.o
>
> The "dllwrap" command gives me following error/s:
> foo.o(.text+0x28):foo.cpp: undefined reference to
`__gxx_personality_sj0'
< snip >
Tell dllwrap to link in libstdc++ by setting language to C++:
dllwrap --driver-name c++ --dllname=foo.dll foo.o
Better yet, use g++ -shared, instead of dllwrap, to build the dll
g++ -DBUILD_DLL -O3 -c foo.cpp
g++ -shared -o foo.dll foo.o
Danny