exceptions without libstdc++

Erik Smith ersmith@ucsd.edu
Mon Jun 12 00:13:00 GMT 2000


How do I compile a program with exceptions without linking in 
libstdc++?   I'm trying to reduce the size of my program by excluding the 
standard library which I'm not using.  I'm linking with the following options:

-nodefaultlibs -lc -lgcc

as soon as I have a throw I get the following link errors:

bench1cpp.o(.text+0x1c): undefined reference to `__eh_alloc'
bench1cpp.o(.text+0x31): undefined reference to `int type_info function'
bench1cpp.o(.text+0x38): undefined reference to `__cp_push_exception'
bench1cpp.o(.text+0x3d): undefined reference to `__throw'
bench1cpp.o(.text+0x53): undefined reference to `__throw'
bench1cpp.o(.text+0x61): undefined reference to `__start_cp_handler'
bench1cpp.o(.text+0x6c): undefined reference to `__cp_pop_exception'
bench1cpp.o(.text+0x78): undefined reference to `__throw'
bench1cpp.o(.text+0x85): undefined reference to `__cp_pop_exception'
bench1cpp.o(.text+0x93): undefined reference to `terminate(void)'

which library do I need?

erik




More information about the Gcc mailing list