Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator, MinGW and C++ 11.
Forum Updated to NodeBB v4.3 + New Features

Qt Creator, MinGW and C++ 11.

Scheduled Pinned Locked Moved Qt Creator and other tools
11 Posts 4 Posters 15.8k 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.
  • G Offline
    G Offline
    goetz
    wrote on last edited by
    #2

    add to your .pro file:

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

    Have a look at "this older thread":/forums/viewthread/6731 too. The tag search on c++0x should give you some additional infos too.

    http://www.catb.org/~esr/faqs/smart-questions.html

    1 Reply Last reply
    0
    • O Offline
      O Offline
      objectref
      wrote on last edited by
      #3

      Ok, Volker, many thanks for the help!

      I will check it out tomorrow, when i go back to work, and report back.

      Thanks again!

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

        C++11 support in MinGW 4.4 is mediocre, at best. Prepare for a lot of unsupported stuff and compiler crashes. I strongly advise to upgrade to a recent GCC / MinGW version.

        1 Reply Last reply
        0
        • O Offline
          O Offline
          objectref
          wrote on last edited by
          #5

          @Volker:
          It (somewhat) works now. For example, the "auto" is now recognized but a line such as this:
          [] { cout << "Hello, my friends"; }();

          does not compile. So it seems that it "doesn't know" about lambdas!

          @Lukas:
          You have absolutely right...
          My Qt installer, set up compiler stuff at C:\QtSDK\mingw\bin, where i can see gcc.exe and ming32-gcc.exe (among other files) both at version 4.4.0.

          Do you think i should wait for Qt-Updater to update my installation to a more recent versions of the compiler or should (can) i do it myself without mess up anything ?

          Thank you both for the help!

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

            I'm unaware of any plans of upgrading MinGW in the Qt SDK (please correct me if I'm wrong). I either would switch to MSVC2010 (the compiler that comes with the express edition can be used to create commercial applications at no cost as well) or a recent version of MinGW, like "TDM-GCC":http://tdm-gcc.tdragon.net/ or "MinGW-w64":http://mingw-w64.sourceforge.net/.

            1 Reply Last reply
            0
            • O Offline
              O Offline
              objectref
              wrote on last edited by
              #7

              Ok, i will try this TDM-GCC package that you proposed. Have you experiment any difficulties/problems with the debugger (gdb) so far ?

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

                To be honest I've switched to MSVC2010 and it is quite a while since I used TDM-GCC, but feel free to come back if you experience any issues.

                1 Reply Last reply
                0
                • O Offline
                  O Offline
                  objectref
                  wrote on last edited by
                  #9

                  Hmm..i installed TDM-GCC and get the up-to-date MinGW stack and now, there is no way i can make GDB work again from inside Creator..."Executable failed. During startup program exited with code 0x0"

                  I cannot understand why C++ dev-stack is so complicated to setup correctly, at least on Windows.

                  Anyway.

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    bmanc
                    wrote on last edited by
                    #10

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

                    and also tried
                    @QMAKE_CXXFLAGS += -std=gnu++0x@

                    in my projects, with the Qt 4.8.0 and Qt 4.8.1 on Windows 7 (64-bit). Both were using mingw4.4.

                    I get segmentation faults during the compile.

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      bmanc
                      wrote on last edited by
                      #11

                      Sorry for the almost immediate second post - I downloaded QtCreator 2.5 RC, and used the MinGW 4.6.2 that comes bundled with it. Everything compiled and ran!

                      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