ndk
ndk copied to clipboard
My resolution for the issues w.r.t c++11 supporting and header not found
hi all,
I resolved the issues w.r.t. "'stoi' is not a member of 'std'" ,"stddef.h: No such file or directory"
with the following steps:
-
enter the directory "android-ndk-r13b/build/tools"
-
then get the toolchain using: sh make-standalone-toolchain.sh --arch=arm
--platform=android-16
--install-dir=/somewhere/Android-16_Toolchain
--stl=libc++ -
compile your c++11 .cpp file using the following command: /somewhere/Android-16_Toolchain/bin/arm-linux-androideabi-g++ -std=c++11
-isystem /somewhere/Android-16_Toolchain/include/c++/4.9.x/ -o test test.cpp -lc++_shared
libc++ covers the unsupported std:: functions by the default libgnustl, and "-isystem" resolves the header including problem.