Can anybody tell me how to activate RTTI in c++ when working on unix. I heard that it can be disabled and enabled. on my unix environment,how could i check whether RTTI is e
gcc has it on by default. Check if typeid(foo).name() gives you something useful.
#include <iostream> #include <typeinfo> int main() { std::cout << typeid(int).name() << std::endl; return 0; }
Without RTTI you get something like:
foo.cpp:6: error: cannot use typeid with -fno-rtti