如何在Catia CAA中启用运行时类型信息?

时间:2019-08-09 05:55:50

标签: visual-studio-2012 rtti catia caa

在使用CAA C ++接口为Catia开发插件时,我需要进行dynamic_cast:

DerivedClass *derived = dynamic_cast<*derived>(base);

Build with mkmk时,编译器发出警告:

[MkMk] warning C4541: 'dynamic_cast' used on polymorphic type '<DerivedClass>' with /GR-; unpredictable behavior may result

我试图通过在模块的LOCAL_CCFLAGS = /GR中添加Imakefile.mk来启用运行时类型信息。但是编译器会覆盖此标志并禁用RTTI:

[MkMk] Command line warning D9025 : overriding '/GR' with '/GR-'
[MkMk] warning C4541: 'dynamic_cast' used on polymorphic type '<DerivedClass>' with /GR-; unpredictable behavior may result

如何正确启用RTTI?

0 个答案:

没有答案