10 years, 9 months ago.  This question has been closed. Reason: This topic moved to http://mbed.org/forum/bugs-suggestions/topic/4494/

Identifier "typeid" is undefined problem

Hello,

I try to compile following code. But mbed compiler say ""Identifier "typeid" is undefined" in file "/main.cpp", Line: 12, Col: 1"

Can't current mbed compiler use typeid?

sample

#include "mbed.h"
#include <typeinfo>
DigitalOut myled(LED1);

class A
{
};

int main()
{
    A a;
    if(typeid(a)==typeid(A)){
        myled=1;
    }
    
}

This topic moved to http://mbed.org/forum/bugs-suggestions/topic/4494/

posted by Ryo Iizuka 06 Aug 2013

3 Answers

10 years, 9 months ago.

Hello Ryo lizuka,

RTTI is disabled by default which typeid requires. You can export it to any offline tool and turn RTTI back on. Your example compiles without error with rtti compiler option set.

Regards,

0xc0170

Accepted Answer
Ryo Iizuka
poster
10 years, 9 months ago.

Hello Martin-san,

Thank you for response.

It was possible to compile by previous mbed compiler. I want to know whether the problem is temporary or not. Do you know the information for that?

Regards.

10 years, 9 months ago.

I have this same problem. It only started occurring on Friday afternoon.