Linking issue with c++

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
tonytian
Posts: 17
Joined: Tue Jul 12, 2011 2:53 pm

Linking issue with c++

Post 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.
User avatar
Nessphoro
Member
Member
Posts: 308
Joined: Sat Apr 30, 2011 12:50 am

Re: Linking issue with c++

Post by Nessphoro »

Can we see your linker script, sir?
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Linking issue with c++

Post 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.
tonytian
Posts: 17
Joined: Tue Jul 12, 2011 2:53 pm

Re: Linking issue with c++

Post 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.
Post Reply