Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-39057

Precompiled header in Mac cannot have C++11 features

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.2.1
    • Build System
    • None
    • Mac + clang
    • macOS

    Description

      When using precompiled header, it cannot have c+11 features or the build simply failed. CONFIG += c11 and QMAKE_CXXFLAGS += -std=c+11 have all been tried, but neither will work. Building without a precompiled header works fine, so it must be a bug in the build system.

      The command line invoked by the build system is

      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -pipe -O2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.7 -Wall -W -fPIE -I../Qt/5.2.1/clang_64/mkspecs/macx-clang -I../TestPre -I. -x objective-c+-header -c ../TestPre/stable.hpp -o TestPre/objective-c+.pch

      . As one can see, there is no -std=c++11 flag passed in.

      Precompiled headers works fine in Windows environment. This issue is Mac specific.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              vestbo Tor Arne Vestbø
              netheril96 Siyuan Ren
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes