This is the mail archive of the gcc@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: Exceptions won't work in my dll!


Never uses "ld" directly and use gcc instead.


H.J.
---
On Wed, Sep 03, 2003 at 03:33:26PM -0400, Ahern, Charles J wrote:
> Can someone please help me understand why exceptions will not work in my dll file.  anytime i do a throw (although they are being caught) it will crash.
> 
> here's the makefile, the problem must be some sort of compile option:
> 
> 
> 
> # Makefile for building the UUT317 Library: lib317.so.$(VERSION)
> # Currrent SW Version: 1.0
> 
> 
> VERSION = 1
> 
> MAIN    = lib317.o Globals_317.o Lib317_Exceptions.o
> COMMON  = GATAC.o ICPUTL.o Lib317_Utils.o
> TESTS   = Group_1.o
> 
> OBJECTS = $(MAIN) $(COMMON) $(TESTS) 
> 
> HEADERS = ATAC16.h GATAC.h Globals_317.h ICPUTL.h Lib317_Exceptions.h Lib317_Utils.h Group_1.h
> 
> 
> 
> 
> #
> # Code Generation Options:
> # -fPIC:        If supported for the target machine, emit position-independent code,
> #               suitable  for  dynamic  linking, even if branches need large displacements.
> # -fexceptions: Ensure exceptions are turned on, may be needed for c code that still
> #               needs exception handling.
> #
> COPTS = -fPIC -fexceptions
> 
> 
> 
> #
> # LDIRS: directories to search for library files
> # IDIRS: directories to search for #include header files
> #
> LDIRS = -L/usr/lib/gcc-lib/i386-redhat-linux/2.96/ -L/user/lib
> IDIRS = -I/usr/local/LibEWE
> 
> 
> 
> #
> # Compile Flags:
> # -O2: Optimize even more.  Nearly all supported optimizations
> #      that  do  not involve a space-speed tradeoff are performed.
> #   c: compile but do not link yet
> # 
> CFLAGS = $(IDIRS) -O2 -c
> 
> 
> all: clean lib317.so.$(VERSION)
> 
> clean:
> 	rm -rf *~ *.o *.so *.so.*
> 
> lib: lib317.so.$(VERSION)
> 
> 
> lib317.so.$(VERSION): $(OBJECTS)
> 	ld  -E -shared -o lib317.so.$(VERSION) $(OBJECTS) $(LDIRS) -lc -lstdc++
> 	/sbin/ldconfig -v -n .
> 	ln -sf $(PWD)/lib317.so.$(VERSION) /usr/EWE/TPS/lib317.so
> 
> 
> lib317.o:   $(HEADERS) lib317.cpp
> 	g++ $(COPTS) $(CFLAGS) $(basename $@).cpp
> 
> Lib317_Utils.o:  $(HEADERS) Lib317_Utils.cpp
> 	g++ $(COPTS) $(CFLAGS) $(basename $@).cpp
> 
> Globals_317.o: $(HEADERS) Globals_317.cpp
> 	g++ $(COPTS) $(CFLAGS) $(basename $@).cpp
> 
> Lib317_Exceptions.o:  $(HEADERS) Lib317_Exceptions.cpp
> 	g++ $(COPTS) $(CFLAGS) $(basename $@).cpp
> 
> GATAC.o:   $(HEADERS) GATAC.cpp
> 	g++ $(COPTS) $(CFLAGS) $(basename $@).cpp
> 
> ICPUTL.o:  $(HEADERS) ICPUTL.cpp
> 	g++ $(COPTS) $(CFLAGS) $(basename $@).cpp
> 
> Group_1.o: $(HEADERS) Group_1.cpp
> 	g++ $(COPTS) $(CFLAGS) $(basename $@).cpp
> 


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