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. Using C++11 with provided binaries of Qt5.0.0 on a Mac?
Forum Updated to NodeBB v4.3 + New Features

Using C++11 with provided binaries of Qt5.0.0 on a Mac?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.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.
  • S Offline
    S Offline
    sfilippidis
    wrote on last edited by
    #1

    I use the provided binaries (from downloads section) for Qt5.0.0 for my Mac. Can I use C++11, and if yes, is there something special I need to do?

    https://www.filippidis.name/

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

      In Qt5 I think there so no need to do anything special. In Qt4 you had to sent a flag to enable C++0x. Clang support for C++11 is pretty good, actually last time I checked it was the most complete. Just to be sure write a lambda or two, some auto identifiers and so on and see if you get errors.

      I am not a mac user, but I used Qt5 with MSVC2012 C++11 features out of the box. Should be the same for mac.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sfilippidis
        wrote on last edited by
        #3

        Yes, the problem is that I get errors!

        E.g.: if I use

        @auto x = 1;@

        I get the error:

        @/Users/username/programname/main.cpp:7: error: ISO C++ forbids declaration of 'x' with no type@

        So the word auto is NOT properly recognised with its C++11 meaning!

        Maybe I am using the wrong compiler (GCC instead of Clang)? If I go to Qt Creator ---> Preferences... ---> Build and Run ---> Kits, I have an auto-detected kit named "Desktop Qt 5.0.0 clang 64bit (SDK)" as default, but if I view its specifications, it mentions as "Compiler:" not Clang, but "GCC (x86 64bit).

        https://www.filippidis.name/

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

          For GCC you may still need to pass the "-std=gnu++0x" flag, provided of course your GCC version is not too ancient. I'd rather use Clang, "from the looks of it, Qt 5.0.1 will launch any day now with prebuild binaries for Clang":http://releases.qt-project.org/digia/5.0.1/latest_successful/ for mac.

          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