activate RTTI in c++

后端 未结 7 1782
日久生厌
日久生厌 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:18

    RTTI will be enabled or disabled when compiling your program via compiler options - it's not something enabled or disabled in the Unix environment globally. The easiest way to see if it's enabled by default for your compiler is to just try compiling some code using RTTI.

    Options to enable/disable RTTI will be compiler specific - what compiler are you using?

    RTTI support is on by default in GCC, the option -fno-rtti turns off support (in case you're using GCC and maybe someone's turned off RTTI in a makefile or something).

提交回复
热议问题