Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile NDK code using gnu libstdc++

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

like image 797
Sreekanth Karumanaghat Avatar asked Jul 26 '12 05:07

Sreekanth Karumanaghat


1 Answers

You should 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 the example of typical Application.mk (it should be placed into 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 on Application.mk can be found in your NDK docs: docs/APPLICATION-MK.html

like image 98
Sergey K. Avatar answered Oct 06 '22 00:10

Sergey K.