Android std and stl support

前端 未结 1 989
不知归路
不知归路 2020-12-13 22:26

I am playing with android ndk. I am using Window Vista with cygwin (latest version). I compiled and launched the hello world jni sample on my phone. It is working. The code

相关标签:
1条回答
  • 2020-12-13 22:53

    From NDK r5's docs/CPLUSPLUS-SUPPORT.html:

    By default, the headers and libraries for the minimal C++ runtime system library (/system/lib/libstdc++.so) are used when building C++ sources.

    You can however select a different implementation by setting the variable APP_STL to something else in your Application.mk, for example:

    APP_STL := stlport_static

    To select the static STLport implementation provided with this NDK. Value APP_STL values are the following:

    system -> Use the default minimal C++ runtime library.
    stlport_static -> Use STLport built as a static library.
    stlport_shared -> Use STLport built as a shared library.
    gnustl_static -> Use GNU libstdc++ as a static library.

    Which NDK are you using? Have you tried compiling one of the sample applications that utilize the STL such as test-libstdc++?

    0 讨论(0)
提交回复
热议问题