smart pointers not working with Android NDK r8

前端 未结 2 1501
情话喂你
情话喂你 2020-12-15 08:31

I can\'t figure out how to use shared pointers within my Android project. I\'m using the latest Eclipse ADT on Mac OS X with the Android NDK r8d.

Here is what is in

相关标签:
2条回答
  • 2020-12-15 09:17

    Be sure that the standard library include path (like /android-ndk-r8d/sources/cxx-stl/gnu-libstdc++/4.7/include) is in the target settings.

    To get the IDE to recognize C++11 classes in the GNU standard library, add __GXX_EXPERIMENTAL_CXX0X__ as a predefined macro to the indexer. (The name is a bit of anachronism since C++11 is standardized and the support is no longer experimental, but as yet that's what it's called.) Also, be sure the indexer is set to reflect the correct build target.

    0 讨论(0)
  • 2020-12-15 09:30

    these settings did it for me:

    Application.mk:

    NDK_TOOLCHAIN_VERSION=4.7
    APP_STL := gnustl_static
    

    Android.mk:

    LOCAL_CFLAGS :=-D__GXX_EXPERIMENTAL_CXX0X__  <--important
    LOCAL_CPPFLAGS  := -std=c++11
    

    Eclipse Settings: C/C++ General\Path and Symbols should contain:

    C:\android\ndk\sources\cxx-stl\gnu-libstdc++\4.7\include
    C:\android\ndk\sources\cxx-stl\gnu-libstdc++\4.7\libs\armeabi\include
    
    0 讨论(0)
提交回复
热议问题