...one of the most highly
regarded and expertly designed C++ library projects in the
world. — Herb Sutter and Andrei
Linking a binary from source files that were compiled with different RTTI flags
is not a very good idea and may lead to a lot of surprises. However if there
is a very strong need, TypeIndex library provides a solution for mixing sources:
macro. This would lead to usage of same type_index class (
boost::typeindex::stl_type_index) all around the project.
Do not forget to rebuild all the projects
You must know that linking RTTI on and RTTI off binaries may succeed even without
macro, but that does not mean that you'll get a working binary. Such actions
may break the One Definition Rule. Take a look at the table below, that shows
boost::type_index get_integer(); function will look like with different RTTI
Such differences are usually not detected by linker and lead to errors at runtime.