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]

exceptions without libstdc++-v3?



I'm trying to hunt down the mystery problems with exceptions in
gcj-mingw by trying C++ exceptions first.

What do I need to link in to a program to get exception support?
libstdc++-v3 doesn't build on mingw -- do you need it in order to have
exception support?

$ cat test4.cc
class foo {
public: foo() {
}
};


int main() {
  try {
    throw new foo();
  } catch (foo* f) {
  }
}

$ /usr/local/gcc/bin/i686-pc-mingw32-gcc test4.cc -o test4.exe
/tmp/ccEZ1CPd.o(.text+0x1f):test4.cc: undefined reference to `__gxx_personality_sj0'
/tmp/ccEZ1CPd.o(.text+0x5c):test4.cc: undefined reference to `operator new(unsigned)'
/tmp/ccEZ1CPd.o(.text+0xb3):test4.cc: undefined reference to `operator delete(void*)'
/tmp/ccEZ1CPd.o(.text+0xd2):test4.cc: undefined reference to `operator delete(void*)'
/tmp/ccEZ1CPd.o(.text+0xde):test4.cc: undefined reference to `__cxa_allocate_exception'
/tmp/ccEZ1CPd.o(.text+0x104):test4.cc: undefined reference to `__cxa_throw'
/tmp/ccEZ1CPd.o(.text+0x127):test4.cc: undefined reference to `__cxa_begin_catch'
/tmp/ccEZ1CPd.o(.text+0x12f):test4.cc: undefined reference to `__cxa_end_catch'
/tmp/ccEZ1CPd.o(.data$_ZTIP3foo+0x0):test4.cc: undefined reference to `vtable for __cxxabiv1::__pointer_type_info'
/tmp/ccEZ1CPd.o(.data$_ZTI3foo+0x0):test4.cc: undefined reference to `vtable for __cxxabiv1::__class_type_info'


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