activate RTTI in c++

后端 未结 7 1806
日久生厌
日久生厌 2020-12-09 14:37

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

7条回答
  •  没有蜡笔的小新
    2020-12-09 15:34

    Are you using g++ or some other compiler?

    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

    UPDATE

    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.

提交回复
热议问题