How do I turn on RTTI with Cygwin?

柔情痞子 提交于 2020-01-14 12:37:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!