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. [DUPLICATE] Trying to build for Android, Qt 5.2.2, GCC 4.8 and C++11

[DUPLICATE] Trying to build for Android, Qt 5.2.2, GCC 4.8 and C++11

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 2.0k Views 1 Watching
  • 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.
  • E Offline
    E Offline
    EricRFMA
    wrote on last edited by
    #1

    Hello... hope this is a simple question...

    I'm trying to build a Qt project (in Qt Creator 3.0.1), with Qt 5.2.2 and android-ndk-r9c. I set <code>CONFIG+=c++11</code>, which didn't supply the needed <code>-std=c++11</code>, so I added <code>QMAKE_CXXFLAGS+=-std=c++11</code>. The existing <code>android-g++/qmake.conf</code> added <code>-std=gnu++0x</code>, so I was ending up the <code>-std=gnu++0x -std=c++11</code>.

    The problem I was seeing was that the compiler wasn't recognizing some C++11 features (specifically <code>shared_ptr</code>). I finally tried a compilation line that looked like this:

    @/Volumes/Projects/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++ -c -pipe -std=c++11 -O0 -g -g -gdwarf-2 -marm -O0 -fno-omit-frame-pointer -Wall -Wno-psabi -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../qt5.2.1-android/mkspecs/android-g++ -I../WeightPlates -I../../qt5.2.1-android/include -I../../qt5.2.1-android/include/QtWidgets -I../../qt5.2.1-android/include/QtGui -I../../qt5.2.1-android/include/QtCore -I. -I. -I../../android-ndk-r9c/sources/cxx-stl/gnu-libstdc++/4.8/include -I../../android-ndk-r9c/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I../../android-ndk-r9c/platforms/android-9/arch-arm/usr/include -I. -o main.o ../WeightPlates/main.cpp@

    This only had <code>-std=c++11</code>, but I still got the same errors, e.g.

    @../WeightPlates/weightplate.h:41:9: error: 'shared_ptr' does not name a type
    typedef shared_ptr<plateDesc> plateDescsp; // shared pointer for plateDesc@

    I'm not sure offhand if I'm using any other C++11 features, and this is the only one I was getting complaints about.

    Does this sound familiar to anyone?

    Thanks for your help...

    -Eric

    1 Reply Last reply
    0
    • E Offline
      E Offline
      EricRFMA
      wrote on last edited by
      #2

      Sorry, I'm such a yutz... I thought this problem sounded familiar, and sure enough I reported it (and found the fix) a while ago: "My previous post":http://qt-project.org/forums/viewthread/31194/

      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