Linker error: undefined reference to typeinfo for A with no-rtti option

Ian Lance Taylor iant@google.com
Wed Apr 14 00:31:00 GMT 2010


Дмитрий Оксенчук <oksenchuk89@gmail.com> writes:

> Linker doesn't say anything when i create any virtual function in B or
> replace virtual ~A() to virtual void f() for example.

Read about the key method and type_info objects here:

http://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html

I won't go into all the details, but basically if you mix -frtti and
-fno-rtti code you need to ensure that any classes created in the
-frtti code have their key method compiled with -frtti.

Ian



More information about the Gcc-help mailing list