Cannot dynamic cast with RTTI enabled

I have similar problem to the one in: https://answers.unrealengine.com/questions/597801/cannot-dynamic-cast-with-rtti-enabled.html

First, do I have to rebuild my project after enabling RTTI?

The solution in the post above was to use export tag ***_API in the class involved. I already have done it correctly. Here is the error message:

1>C:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\CoreUObject\Public\Templates/Casts.h(404): error C4541: 'dynamic_cast' used on polymorphic type 'SimTK::Subsystem::Guts' with /GR-; unpredictable behavior may result
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simbody\include\simbody/internal/ForceSubsystemGuts.h(61): note: see reference to function template instantiation 'const SimTK::ForceSubsystem::Guts *UE4Casts_Private::DynamicCast(From *)' being compiled
1>          with
1>          [
1>              From=const SimTK::Subsystem::Guts
1>          ]
1>C:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\CoreUObject\Public\Templates/Casts.h(404): error C4541: 'dynamic_cast' used on polymorphic type 'SimTK::AbstractValue' with /GR-; unpredictable behavior may result
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Value.h(214): note: see reference to function template instantiation 'const SimTK::Value *UE4Casts_Private::DynamicCast*,const SimTK::AbstractValue>(From *)' being compiled
1>          with
1>          [
1>              T=SimTK::Real,
1>              From=const SimTK::AbstractValue
1>          ]
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Value.h(214): note: while compiling class template member function 'bool SimTK::Value::isA(const SimTK::AbstractValue &)'
1>          with
1>          [
1>              T=SimTK::Real
1>          ]
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Value.h(196): note: see reference to function template instantiation 'bool SimTK::Value::isA(const SimTK::AbstractValue &)' being compiled
1>          with
1>          [
1>              T=SimTK::Real
1>          ]
1>  D:\Downloads\LucidSim\Libraries\3rdParty\simbody\SimTKCommon\Simulation\include\SimTKcommon/internal/MeasureImplementation.h(573): note: see reference to class template instantiation 'SimTK::Value' being compiled
1>          with
1>          [
1>              T=SimTK::Real
1>          ]
1>  D:\Downloads\LucidSim\Libraries\3rdParty\simbody\SimTKCommon\Simulation\include\SimTKcommon/internal/MeasureImplementation.h(566): note: while compiling class template member function 'void SimTK::Measure_::Implementation::realizeTopology(SimTK::State &) const'
1>  D:\Downloads\LucidSim\Libraries\3rdParty\simbody\SimTKCommon\Simulation\include\SimTKcommon/internal/MeasureImplementation.h(678): note: see reference to class template instantiation 'SimTK::Measure_::Implementation' being compiled
1>d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Array.h(2911): warning C4458: declaration of 'difference_type' hides class member
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Array.h(1545): note: see declaration of 'SimTK::Array_::difference_type'
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Array.h(2870): note: see reference to function template instantiation 'void SimTK::Array_::ctorIteratorDispatch(const ForwardIterator &,const ForwardIterator &,std::forward_iterator_tag)' being compiled
1>          with
1>          [
1>              InputIterator=SimTK::Xml::attribute_iterator,
1>              ForwardIterator=SimTK::Xml::attribute_iterator
1>          ]
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Array.h(2869): note: see reference to function template instantiation 'void SimTK::Array_::ctorIteratorDispatch(const ForwardIterator &,const ForwardIterator &,std::forward_iterator_tag)' being compiled
1>          with
1>          [
1>              InputIterator=SimTK::Xml::attribute_iterator,
1>              ForwardIterator=SimTK::Xml::attribute_iterator
1>          ]
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Array.h(1599): note: see reference to function template instantiation 'void SimTK::Array_::ctorDispatch(const InputIterator &,const InputIterator &,SimTK::FalseType)' being compiled
1>          with
1>          [
1>              InputIter=SimTK::Xml::attribute_iterator,
1>              InputIterator=SimTK::Xml::attribute_iterator
1>          ]
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Array.h(1599): note: see reference to function template instantiation 'void SimTK::Array_::ctorDispatch(const InputIterator &,const InputIterator &,SimTK::FalseType)' being compiled
1>          with
1>          [
1>              InputIter=SimTK::Xml::attribute_iterator,
1>              InputIterator=SimTK::Xml::attribute_iterator
1>          ]
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Xml.h(1306): note: see reference to function template instantiation 'SimTK::Array_::Array_(const InputIter &,const InputIter &)' being compiled
1>          with
1>          [
1>              InputIter=SimTK::Xml::attribute_iterator
1>          ]
1>  d:\downloads\lucidsim\libraries\3rdparty\simbody\simtkcommon\include\SimTKcommon/internal/Xml.h(1306): note: see reference to function template instantiation 'SimTK::Array_::Array_(const InputIter &,const InputIter &)' being compiled
1>          with
1>          [
1>              InputIter=SimTK::Xml::attribute_iterator
1>          ]
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command ""C:\Program Files\Epic Games\UE_4.24\Engine\Build\BatchFiles\Build.bat" VehicleAIEditor Win64 Development -Project="D:\Downloads\MonoDrive\VehicleAI_Editor\VehicleAI.uproject" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.
1>Done building project "VehicleAI.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========