Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Where "-std=gnu++11" came from?

Where "-std=gnu++11" came from?

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 4 Posters 3.7k 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.
  • A Offline
    A Offline
    Alexander Soplyakov
    wrote on 7 Jul 2016, 10:41 last edited by Alexander Soplyakov 7 Jul 2016, 10:44
    #1

    Hello everyone!
    Recently I built Qt 5.7 from source. Next I tried to build my application and was wonder because I saw some
    strange compiler flag during the building process. It is "-std=gnu++11". I didn't set this flag because use "-std=c++11" (or "-std=c++1z") flag.
    When I am compiling the application I see these flags together in the compile console. ("-std=gnu++11" and "-std=c++11")

    Can anyone explain what happens?
    How can I manage this behavior?

    I use OS X 10.11.5 and Clang compiler.

    P 1 Reply Last reply 30 Oct 2016, 22:34
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 Jul 2016, 11:54 last edited by
      #2

      Hi and welcome to devnet,

      Since 5.7 a C++11 capable compiler is required to build Qt.

      AFAIK, it's in the defaults of the CONFIG variable.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • A Offline
        A Offline
        Alexander Soplyakov
        wrote on 7 Jul 2016, 12:15 last edited by
        #3

        I use standard clang++ and clang compilers are delivered with latest Xcode version. The Qt library is built successfully without this issue. I suppose the problem inside the qmake utility for this version. I look into makefiles are generated for the Qt building and for my application. Qt's makefiles don't contain "-std=gnu++11", but makefiles for my application contain the flag.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 12 Jul 2016, 20:50 last edited by
          #4

          It comes from the mkspecs

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Alexander Soplyakov
            7 Jul 2016, 10:41

            Hello everyone!
            Recently I built Qt 5.7 from source. Next I tried to build my application and was wonder because I saw some
            strange compiler flag during the building process. It is "-std=gnu++11". I didn't set this flag because use "-std=c++11" (or "-std=c++1z") flag.
            When I am compiling the application I see these flags together in the compile console. ("-std=gnu++11" and "-std=c++11")

            Can anyone explain what happens?
            How can I manage this behavior?

            I use OS X 10.11.5 and Clang compiler.

            P Offline
            P Offline
            peter.karasev
            wrote on 30 Oct 2016, 22:34 last edited by
            #5

            @Alexander-Soplyakov said in Where "-std=gnu++11" came from?:

            Hello everyone!
            Recently I built Qt 5.7 from source. Next I tried to build my application and was wonder because I saw some
            strange compiler flag during the building process. It is "-std=gnu++11". I didn't set this flag because use "-std=c++11" (or "-std=c++1z") flag.
            When I am compiling the application I see these flags together in the compile console. ("-std=gnu++11" and "-std=c++11")

            Can anyone explain what happens?
            How can I manage this behavior?

            I use OS X 10.11.5 and Clang compiler.

            Did you find out why this happens? I get it on one computer (Mint 17.2) but not elsewhere (Fedora) ... extremely annoying, it errors out whenever a c++14 feature is used like std::make_unique. Argh!

            J 1 Reply Last reply 31 Oct 2016, 07:16
            0
            • P peter.karasev
              30 Oct 2016, 22:34

              @Alexander-Soplyakov said in Where "-std=gnu++11" came from?:

              Hello everyone!
              Recently I built Qt 5.7 from source. Next I tried to build my application and was wonder because I saw some
              strange compiler flag during the building process. It is "-std=gnu++11". I didn't set this flag because use "-std=c++11" (or "-std=c++1z") flag.
              When I am compiling the application I see these flags together in the compile console. ("-std=gnu++11" and "-std=c++11")

              Can anyone explain what happens?
              How can I manage this behavior?

              I use OS X 10.11.5 and Clang compiler.

              Did you find out why this happens? I get it on one computer (Mint 17.2) but not elsewhere (Fedora) ... extremely annoying, it errors out whenever a c++14 feature is used like std::make_unique. Argh!

              J Online
              J Online
              jsulm
              Lifetime Qt Champion
              wrote on 31 Oct 2016, 07:16 last edited by
              #6

              @peter.karasev How do you set the C++ standard?
              It should be "CONFIG += c++11" for C++11 or "CONFIG += c++14" for C++14 in pro file.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              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