public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Exception Handling switch gives linking problems
@ 2004-03-12  0:03 nirav.dalal
  0 siblings, 0 replies; 3+ messages in thread
From: nirav.dalal @ 2004-03-12  0:03 UTC (permalink / raw)
  To: Danny Smith; +Cc: gcc-help


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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Exception Handling switch gives linking problems
@ 2004-03-09  2:09 Danny Smith
  0 siblings, 0 replies; 3+ messages in thread
From: Danny Smith @ 2004-03-09  2:09 UTC (permalink / raw)
  To: gcc-help; +Cc: nirav.dalal

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Exception Handling switch gives linking problems
@ 2004-03-08 19:40 nirav.dalal
  0 siblings, 0 replies; 3+ messages in thread
From: nirav.dalal @ 2004-03-08 19:40 UTC (permalink / raw)
  To: gcc-help

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'
foo.o(.text+0x24a):foo.cpp: undefined reference to `__gxx_personality_sj0'
foo.o(.text+0x632):foo.cpp: undefined reference to `__gxx_personality_sj0'
dllwrap: gcc exited with status 1

So if I want to remove "-fno-exceptions" or in other words enable exception
handling in GCC, the link command does NOT like it. How else can we enable
exception handling?

Any help on this problem is appreicated.

The GCC version I'm using is:
>gcc --version
gcc (GCC) 3.3.1 (mingw special 20030804-1)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks,
- Nirav


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-11 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-12  0:03 Exception Handling switch gives linking problems nirav.dalal
  -- strict thread matches above, loose matches on Subject: below --
2004-03-09  2:09 Danny Smith
2004-03-08 19:40 nirav.dalal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).