I have a static library which is build using /GR-
(RTTI disabled), in CMake:
add_library(LibName STATIC someSource.cpp)
target_compile_options(LibName PRIVATE /GR-)
...
And my executable is build using /GR
(RTTI enabled) and is depending on the library:
target_link_libraries(myTarget ${LibName})
target_compile_options(myTarget PRIVATE /GR)
...
When doing the same with GCC respectively using flags -fno-rtti
& -frtti
, you'll get linker errors like: undefined reference to typeinfo for ClassName
.
Why not for MSVC, do I need to be worried? Or is this a feature of MSVC?