Compile NDK code with gnu libstdc ++

I want to compile my NDK code using gnu libstdc ++, any key how to do this?

+6
source share
2 answers

You must add a line to Application.mk

 APP_STL := gnustl_static 

if you want to link it statically, and

 APP_STL := gnustl_shared 

if you want to use it as a shared library.

Here is an example of a typical Application.mk (it should be placed in the same folder where your Android.mk is located):

 APP_OPTIM := release APP_PLATFORM := android-7 APP_STL := gnustl_static APP_CPPFLAGS += -frtti APP_CPPFLAGS += -fexceptions APP_CPPFLAGS += -DANDROID APP_ABI := armeabi-v7a 

More information about Application.mk can be found in your NDK docs/APPLICATION-MK.html : docs/APPLICATION-MK.html

+7
source

Add the following line to your Application.mk:

 APP_STL := gnustl_static 

(or gnustl_shared if you do not want to statically link to it).

+4
source

Source: https://habr.com/ru/post/921365/


All Articles