Page 1 of 1

Linking issue with c++

Posted: Tue Jul 26, 2011 7:00 pm
by tonytian
Hello,

I got the following linking errors:

Code: Select all

undefined reference to `_Unwind_Resume'
undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info

I used virtual functions/destructors in my code. I did put in

Code: Select all

extern "C" void __cxa_pure_virtual()
{
 // dummy 
}

extern "C" void __pure_virtual()
{
 // dummy 
}
Anybody can help me on this? Thanks.

Re: Linking issue with c++

Posted: Tue Jul 26, 2011 10:53 pm
by Nessphoro
Can we see your linker script, sir?

Re: Linking issue with c++

Posted: Tue Jul 26, 2011 11:22 pm
by jnc100
I presume you are using g++. If so what options are you passing to g++? It looks like you are not passing -fno-rtti and -fno-exceptions. The wiki contains a recommended set of options to pass here. If you are passing all of these, which version of g++ are you using?

Regards,
John.

Re: Linking issue with c++

Posted: Wed Jul 27, 2011 11:07 am
by tonytian
Your are right. Using these options solves the problem. Thanks, John!
jnc100 wrote:I presume you are using g++. If so what options are you passing to g++? It looks like you are not passing -fno-rtti and -fno-exceptions. The wiki contains a recommended set of options to pass here. If you are passing all of these, which version of g++ are you using?

Regards,
John.