问题
When my Android NDK C++ native code is compiled, the following error appears:
error: 'dynamic_cast' not permitted with -fno-rtti
Someone told me to turn on RTTI, but I didn't know how to do. Do I need to modify Application.mk
or what?
my Application.mk
:
# it is needed for ndk-r5
APP_STL := stlport_static
APP_ABI := armeabi armeabi-v7a
APP_MODULES := cocos2d cocosdenshion chipmunk box2d tempestkeep
When I add APP_CPPFLAGS += -frtti
in some .o file appears another error:
undefined reference to `typeinfo for std::ios_base'
回答1:
Looks like you need to remove -fno-rtti
gcc option in Application.mk. Look for it in APP_CPPFLAGS
variable in Application.mk.
来源:https://stackoverflow.com/questions/7427748/how-do-i-turn-on-rtti-with-cygwin