Exception Handling switch gives linking problems

nirav.dalal@teradyne.com nirav.dalal@teradyne.com
Fri Mar 12 00:03:00 GMT 2004

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                                                                                      
                      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

< 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


More information about the Gcc-help mailing list