This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]