Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

aboeing

RTTI macro & g++

This topic is 5347 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I cant seem to find any macro that is defined if g++ has rtti enabled or not. According to a document I read somewhere __RTTI should be defined, but that doesnt seem to be the case. Does anyone know if a macro does get defined, and what it is? Alternatively a way to create an error at compile-time if rtti is not available? (turn of rtti via : g++ -fno-rtti) Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Do you mean you can't find it defined in a file?

It won't be in a file but it will be as if its defined on the command line.

Try compiling this with the rtti enabled/disabled


#include <iostream>
int main() {
#ifdef __RTTI
std::cout << "Rtti enabled\n";
#endif
#ifndef __RTTI
std::cout << "Rtti disabled\n";
#endif
return 0;
}


Some docs I found said it was only for Tru64 so maybe that's your problem.

[edited by - petewood on March 25, 2004 4:23:24 AM]

Share this post


Link to post
Share on other sites
Hi yeah, thanks, I tried that.
Perhaps I have the RTTI switches wrong?
g++ -fno-rtti
and
g++ -frtti

also, if you use the -v option, I assume gcc displays all the #defines? is this correct? because I cant see any difference in the information it displays if rtti is enabled/disabled.

quote:

Alternatively a way to create an error at compile-time if rtti is not available?


Any ideas?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!