Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

C++11 support for Android NDK in Qt Creator



  • I have tried to integrate the https://github.com/nlohmann/json library in my Qt project for Android. When I compile I get many errors:

    error: 'to_string' is not a member of 'std'
    error: 'strtof' is not a member of 'std'
    

    and others. It seems that some C++11 features are missing in the build. I know that in Android Studio projects you can add APP_STL:=c++_static to the Application.mk file and that should solve the issue. But how can I add C++11 support for Android NDK in a project in Qt Creator? I have already added this to my .pro file:

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


  • @daljit97 said in C++11 support for Android NDK in Qt Creator:

    I have already added this to my .pro file

    That project is CMake based. How are you building the library?



  • Well since it is a header only library, I just downloaded the header and included it in my project like this:

    #include <nlohmann/json.hpp>
    

    Running it on Desktop (Linux) works fine


Log in to reply