Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use C++11 in QtCreator 2.4.1?

How to use C++11 in QtCreator 2.4.1?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 3.4k 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.
  • T Offline
    T Offline
    Tyrant
    wrote on last edited by
    #1

    I did some searches and found that people suggesting adding this flag to the .pro file.

    @QMAKE_CXXFLAGS += -std=c++0x@

    Unfortunately it doesn't seem to make any difference, any idea?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Qt Creator 2.4.1 has very limited support for C++0x itself. So you will get strange effects in the UI when using C++0x. None of the CXXFLAGS will change anything there.

      What this flag does is to instruct the compiler used by Creator to accept C++0x code. I am not sure how portable this is between compilers, so you might want to only add this flags to gcc based compilers:-)

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tyrant
        wrote on last edited by
        #3

        Hi Tobias,

        Thanks for your quick response. If C++0x isn't supported in Qt 2.4.1, then do you know what future version will fully support it?
        By the way, Qt4 framework is just brilliant. I'm been learning for 3 days and fell deeply in love with it ;)

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          "2.5":http://labs.qt.nokia.com/2012/07/25/qt-creator-2-5-1-released/ has improved support for C++11.

          1 Reply Last reply
          0
          • U Offline
            U Offline
            utcenter
            wrote on last edited by
            #5

            On a side note, besides newer version of creator you will need a newer version of GCC, since the compiler, shipping with Qt is a rather ancient version with very limited c++11 support. Or alternatively, use it with the MSVC compiler, although GCC 4.7+ has significantly better c++11 feature support, but for MSVC you have precompiled libraries.

            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