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?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 4 Posters 3.8k Views 2 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.
  • Alexander SoplyakovA Offline
    Alexander SoplyakovA Offline
    Alexander Soplyakov
    wrote on last edited by Alexander Soplyakov
    #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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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
      • Alexander SoplyakovA Offline
        Alexander SoplyakovA Offline
        Alexander Soplyakov
        wrote on 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
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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
          • Alexander SoplyakovA Alexander Soplyakov

            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 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!

            jsulmJ 1 Reply Last reply
            0
            • P peter.karasev

              @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!

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on 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