Issue
I created an Android project with default C++ toolchain. Now when I was trying to include code snippets from sample projects on oboe containing C++14 features I keep on getting errors. So I tried included code to create a template but now it is making my code messy and dumped with the declarations which I will prefer not to have.
I tried referring to following questions.
But all these answers seem outdated or I am missing something. There is no Android.mk file in my project structure neither I can find settings that they are suggesting to change.
I suspect the Android studio interface was changed after posting these answers. So what is the right way to change C++ toolchain version in Android Studio 3+?
Solution
You specify it in your app/build.gradle
script.
android {
defaultConfig {
externalNativeBuild {
cmake {
cppFlags "-std=c++14"
}
}
}
}
Change cmake
to ndkBuild
depending on which method you're using.
Answered By - Michael
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.