lundi 30 juillet 2018

How to add C++11 support in a Qt project for Android?

So I am using Qt 5.11 to build an app for Android. In the process I used this C++11 library https://github.com/nlohmann/json since the default json support provided by Qt has some problems. Anyway when I compile the project for Android it start giving me errors like: error: 'to_string' is not a member of 'std'. I found out that the Android SDK has some problems using the entirety of the feature provided by C++11. There are a few suggestions made at the following links Android ndk std::to_string support and How to use std::stoul and std::stoull in Android?

A solution seems to be adding : APP_STL:=c++_static to the Application.mk file in an Android project, but how can I do this in a Qt Project? Do I have to edit build.gradle? I already included (with no success):

CONFIG += c++11 QMAKE_CXXFLAGS += -std=c++11

Aucun commentaire:

Enregistrer un commentaire