【发布时间】:2016-01-19 03:38:30
【问题描述】:
在 Application.mk 文件中,当使用 APP_STL := stlport_static 我可以使用 c++11 dynamic_cast 但它不会编译“随机”功能。
我已经尝试过 APP_STL := gnustl_static 和 APP_STL := c++_static 但它们不允许我使用 dynamic_cast。
Application.mk 的正确设置是什么才能同时使用两者?
我当前的 Application.mk 看起来像:
APP_CPPFLAGS += -std=c++11
APP_STL := stlport_static
APP_ABI := armeabi armeabi-v7a x86
编辑:
按照 Michaels 的指示,最终运行的 Application.mk 是:
#LIBCXX rebuild was needed once when using APP_STL := c++_static
LIBCXX_FORCE_REBUILD := true
APP_CPPFLAGS += -std=c++11 -frtti -fexceptions
APP_STL := c++_static
#Also the gnu compiler can be used
#APP_STL:= gnustl_static
APP_ABI := armeabi armeabi-v7a x86
NDK_TOOLCHAIN_VERSION := 4.8
【问题讨论】:
-
现在在 AOSP 错误跟踪器中打开:Issue 216331: STLport does not support C++11。
标签: android c++11 random java-native-interface dynamic-cast