Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Qt requires C++11" error when building on macOS 10.13.5, Xcode 9.4.1, Qt 5.11.1 #62

Open
ftab opened this issue Jul 21, 2018 · 2 comments

Comments

@ftab
Copy link

ftab commented Jul 21, 2018

Here's my wd.gypi:

{
  'variables': {
    'QT5': '1',
    'WD_CONFIG_QWIDGET_BASE': '1',
# If Qt >= 5.6 set 'WD_CONFIG_WEBKIT' : '0'
    'WD_CONFIG_WEBKIT': '0',
    'WD_CONFIG_QUICK': '1',
    'WD_CONFIG_PLAYER': '0',
    'WD_CONFIG_ONE_KEYRELEASE': '0',
    'QT_INC_PATH': '/Users/fury/Qt/5.11.1/clang_64/include',
    'QT_BIN_PATH': '/Users/fury/Qt/5.11.1/clang_64/bin',
    'QT_LIB_PATH': '/Users/fury/Qt/5.11.1/clang_64/lib'
  },
}

Made the following change to get it to kick off the build (I don't have the 10.8 SDK installed)

diff --git a/wd_build_options.gypi b/wd_build_options.gypi
index 1add240..f7205ba 100644
--- a/wd_build_options.gypi
+++ b/wd_build_options.gypi
@@ -101,7 +101,7 @@
 
     [ 'OS == "mac"', {
       'xcode_settings': {
-        'SDKROOT': 'macosx10.8',
+        'SDKROOT': 'macosx10.13',
         'FRAMEWORK_SEARCH_PATHS': '<(QT_LIB_PATH)',
       },
     } ],

When I build, it runs into a problem with WebDriver_extension_qt_base:

=== BUILD AGGREGATE TARGET WebDriver_extension_qt_base Support OF PROJECT wd_ext_qt WITH THE DEFAULT CONFIGURATION (Default) ===

Check dependencies

PhaseScriptExecution Action\ \"create_input_dir\" build/wd_ext_qt.build/Default/WebDriver_extension_qt_base\ Support.build/Script-9AD8DFE226ABDE58B913A98F.sh
    cd /Users/fury/qtwebdriver
    /bin/sh -c \"/Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base\ Support.build/Script-9AD8DFE226ABDE58B913A98F.sh\"

PhaseScriptExecution Rule\ \"generate_moc\" build/wd_ext_qt.build/Default/WebDriver_extension_qt_base\ Support.build/Script-44E3800321B12D18DC2D95BF.sh
    cd /Users/fury/qtwebdriver
    /bin/sh -c \"/Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base\ Support.build/Script-44E3800321B12D18DC2D95BF.sh\"
note: Generating q_view_runner.cc.
python do_if_modified.py /Users/fury/Qt/5.11.1/clang_64/bin/moc "inc/extension_qt/q_view_runner.h" "/Users/fury/qtwebdriver/build/wd_ext_qt.build/DerivedSources/Default/moc_q_view_runner.cc"
note: Generating vncclient.cc.
note: Generating q_event_filter.cc.
python do_if_modified.py /Users/fury/Qt/5.11.1/clang_64/bin/moc "src/webdriver/extension_qt/q_event_filter.h" "/Users/fury/qtwebdriver/build/wd_ext_qt.build/DerivedSources/Default/moc_q_event_filter.cc"
python do_if_modified.py /Users/fury/Qt/5.11.1/clang_64/bin/moc "inc/extension_qt/vncclient.h" "/Users/fury/qtwebdriver/build/wd_ext_qt.build/DerivedSources/Default/moc_vncclient.cc"

=== BUILD TARGET WebDriver_extension_qt_base OF PROJECT wd_ext_qt WITH THE DEFAULT CONFIGURATION (Default) ===

Check dependencies

Write auxiliary files
write-file /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/WebDriver_extension_qt_base-generated-files.hmap
/bin/mkdir -p /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/Objects-normal/x86_64
write-file /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/Objects-normal/x86_64/WebDriver_extension_qt_base.LinkFileList
write-file /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/WebDriver_extension_qt_base-own-target-headers.hmap
write-file /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/WebDriver_extension_qt_base.hmap
write-file /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/WebDriver_extension_qt_base-all-target-headers.hmap
write-file /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/WebDriver_extension_qt_base-project-headers.hmap
write-file /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/WebDriver_extension_qt_base-all-non-framework-target-headers.hmap

CompileC build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/Objects-normal/x86_64/q_content_type_resolver.o src/webdriver/extension_qt/q_content_type_resolver.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/fury/qtwebdriver
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=204 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -DQT_NO_OPENGL -DNDEBUG -DOS_POSIX -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.13 -g -fvisibility=hidden -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -I/Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/WebDriver_extension_qt_base.hmap -I/Users/fury/qtwebdriver/build/Default/include -Iinc -Isrc -I/Users/fury/Qt/5.11.1/clang_64/include -I/Users/fury/qtwebdriver/build/wd_ext_qt.build/DerivedSources/Default -I/Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/DerivedSources/x86_64 -I/Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/DerivedSources -F/Users/fury/qtwebdriver/build/Default -F/Users/fury/Qt/5.11.1/clang_64/lib -MMD -MT dependencies -MF /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/Objects-normal/x86_64/q_content_type_resolver.d --serialize-diagnostics /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/Objects-normal/x86_64/q_content_type_resolver.dia -c /Users/fury/qtwebdriver/src/webdriver/extension_qt/q_content_type_resolver.cc -o /Users/fury/qtwebdriver/build/wd_ext_qt.build/Default/WebDriver_extension_qt_base.build/Objects-normal/x86_64/q_content_type_resolver.o
In file included from /Users/fury/qtwebdriver/src/webdriver/extension_qt/q_content_type_resolver.cc:20:
In file included from /Users/fury/qtwebdriver/src/webdriver/extension_qt/q_content_type_resolver.h:24:
In file included from /Users/fury/Qt/5.11.1/clang_64/lib/QtNetwork.framework/Headers/QNetworkAccessManager:1:
In file included from /Users/fury/Qt/5.11.1/clang_64/lib/QtNetwork.framework/Headers/qnetworkaccessmanager.h:43:
In file included from /Users/fury/Qt/5.11.1/clang_64/lib/QtNetwork.framework/Headers/qtnetworkglobal.h:43:
In file included from /Users/fury/Qt/5.11.1/clang_64/lib/QtCore.framework/Headers/qglobal.h:105:
/Users/fury/Qt/5.11.1/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:561:6: error: Qt requires a C++11 compiler and yours does not seem to be that.
#    error Qt requires a C++11 compiler and yours does not seem to be that.
     ^
In file included from /Users/fury/qtwebdriver/src/webdriver/extension_qt/q_content_type_resolver.cc:20:
In file included from /Users/fury/qtwebdriver/src/webdriver/extension_qt/q_content_type_resolver.h:24:
In file included from /Users/fury/Qt/5.11.1/clang_64/lib/QtNetwork.framework/Headers/QNetworkAccessManager:1:
In file included from /Users/fury/Qt/5.11.1/clang_64/lib/QtNetwork.framework/Headers/qnetworkaccessmanager.h:43:
In file included from /Users/fury/Qt/5.11.1/clang_64/lib/QtNetwork.framework/Headers/qtnetworkglobal.h:43:
In file included from /Users/fury/Qt/5.11.1/clang_64/lib/QtCore.framework/Headers/qglobal.h:1200:
In file included from /Users/fury/Qt/5.11.1/clang_64/lib/QtCore.framework/Headers/qatomic.h:46:
/Users/fury/Qt/5.11.1/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:61:4: error: "Qt requires C++11 support"
#  error "Qt requires C++11 support"
   ^
/Users/fury/Qt/5.11.1/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:94:13: error: no template named 'QAtomicOps'
    typedef QAtomicOps<T> Ops;
            ^

I can see that there is -std=gnu++11 in wd_build_options.gypi but I don't see a gnu++11 or c++11 flag getting set anywhere in the resulting clang compiler command

How would I go about making sure this flag gets set? Or is that not the real problem?

@ghost
Copy link

ghost commented Aug 10, 2018

@ftab I was able to fix this issue by adding:

'OTHER_CPLUSPLUSFLAGS' : ['-std=gnu++11'],

under osx xcode settings in the wd_build_options.gypi file.

Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@ftab and others