在c ++中激活RTTI [英] activate RTTI in c++
问题描述
任何人都可以告诉我如何在unix上使用c ++激活RTTI。
我听说它可以禁用和启用。
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 enabled or disabled?
我使用的是 aCC
HPUX上的编译器。
I am using the aCC
compiler on HPUX.
推荐答案
/ code>或一些其他编译器?
Are you using g++
or some other compiler?
在 g ++
RTTI默认启用IIRC,可以用 -fno-rtti
禁用它。要测试它是否处于活动状态,请使用 dynamic_cast
或 typeid
In g++
RTTI is enabled by default IIRC, and you can disable it with -fno-rtti
. To test whether it is active or not use dynamic_cast
or typeid
我相信HPUX的 aCC
/ aC ++
默认情况下也有RTTI,我不知道有一种方法禁用它。检查您的男子
页。
I believe that HPUX's aCC
/aC++
also has RTTI on by default, and I am unaware of a way to disable it. Check your man
pages.
这篇关于在c ++中激活RTTI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!