1

While developing a plug-in for Catia using the CAA C++-Interface, I need to do a dynamic_cast:

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

When Build with mkmk, the compiler gives the warning:

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

I tried to enable the run-time type information by adding LOCAL_CCFLAGS = /GR to the Imakefile.mk of the module. But the compiler overwrites this flag and disables the 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

How do I enable the RTTI correctly?

Dragoner
  • 123
  • 1
  • 12
  • 2
    I've seen in some places a LOCAL_POST_CCFLAGS. Naming seems to suggest the flags at the end, hence overriding the mkmk ones. I cannot try it however. For example https://github.com/weltermann17/just-like-java/blob/master/JLJio.m/Imakefile.mk. – cma Nov 25 '19 at 08:07

0 Answers0