ndk icon indicating copy to clipboard operation
ndk copied to clipboard

My resolution for the issues w.r.t c++11 supporting and header not found

Open sliu012 opened this issue 9 years ago • 0 comments

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:

  1. enter the directory "android-ndk-r13b/build/tools"

  2. then get the toolchain using: sh make-standalone-toolchain.sh --arch=arm
    --platform=android-16
    --install-dir=/somewhere/Android-16_Toolchain
    --stl=libc++

  3. 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.

sliu012 avatar Mar 15 '17 08:03 sliu012