Is it possible to compile C++14 source code for Android with ndk10d? I've tried both g++ and clang compilers but it seems that -std=c++14
-std=c++1y
flags do not work.
If I use c++_static
as my APP_STL, i get the following error:
User/someone/Software/Android/android-ndk-r10d/platforms/android-17/arch-arm/usr/include/locale.h:55:1: error: empty struct has size 0 in C, size 1 in C++
Edit: I am using Mac OSX 10.10.4 with Xcode 6.3.2 (able to compile C++14 for iOS).
The Android Native Development Kit (NDK): a toolset that allows you to use C and C++ code with Android, and provides platform libraries that allow you to manage native activities and access physical device components, such as sensors and touch input.
libc++ LLVM's libc++ is the C++ standard library that has been used by the Android OS since Lollipop, and as of NDK r18 is the only STL available in the NDK.
To open a C file using a programming editor, you need to download a C programming editor on your android mobile. These programming editors are available on the google play store for free. Some of the C programming editors available on the google play store are Coding C, Cxxdroid, and C/C++ Programming Compiler.
Code written in C/C++ can be compiled to ARM, or x86 native code (or their 64-bit variants) using the Android Native Development Kit (NDK). The NDK uses the Clang compiler to compile C/C++. GCC was included until NDK r17, but removed in r18 in 2018.
I use android-ndk-r12b-windows-x86_64, compile success with -std=c++14
Android.mk
LOCAL_CPPFLAGS = -Wall -std=c++14
If someone needs an answer to this question, I have found it here.
It's called CrystaX and basically it is a modified version of the Android NDK that allows targeting C++14, Boost libraries and has a number of other features.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With