Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. C++11 support for Android NDK in Qt Creator
Forum Updated to NodeBB v4.3 + New Features

C++11 support for Android NDK in Qt Creator

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 891 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    daljit97
    wrote on last edited by daljit97
    #1

    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
    
    VRoninV 1 Reply Last reply
    0
    • D daljit97

      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
      
      VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      @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?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      0
      • D Offline
        D Offline
        daljit97
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved