Xcode 12.4 requires c++17?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Xcode 12.4 requires c++17?

ken rector
I thought to download and build LibreCAD on my iMac today, 6/12/2023.  This encountered a problem looking for C++17 as shown below.  I am running OS X version 10.15.7 (Catalina) which is the latest available to me on this old machine.  I am running the latest Xcode also available to me which appears to be c++17 compliant.
About xcode shows  Version 12.4 (12D4e)

I feel this ought to work and that I am not selecting the proper compiler.  

Could that be?

Should I try to fall back to an earlier LibreCAD, or try something else?

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=c++1y -O2 -std=gnu++1y  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC -DDWGSUPPORT -DQC_APPDIR="LibreCAD" -DLC_VERSION="2.2.0-alpha" -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I../../libraries/muparser/include -I../../libraries/libdxfrw/src -I../../libraries/jwwlib/src -Icmd -Ilib/actions -Ilib/creation -Ilib/debug -Ilib/engine -Ilib/fileio -Ilib/filters -Ilib/generators -Ilib/gui -Ilib/information -Ilib/math -Ilib/modification -Ilib/printing -Iactions -Imain -Imain/console_dxf2pdf -Itest -Iplugins -Iui -Iui/forms -Iui/generic -I../res -I/usr/local/Cellar/qt@5/5.15.9/lib/QtSvg.framework/Headers -I/usr/local/Cellar/qt@5/5.15.9/lib/QtPrintSupport.framework/Headers -I/usr/local/Cellar/qt@5/5.15.9/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt@5/5.15.9/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt@5/5.15.9/lib/QtCore.framework/Headers -I../../generated/librecad/moc -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AGL.framework/Headers -I../../generated/librecad/ui -I/usr/local/Cellar/qt@5/5.15.9/mkspecs/macx-clang -F/usr/local/Cellar/qt@5/5.15.9/lib -o ../../generated/librecad/obj/rs_snapper.o lib/actions/rs_snapper.cpp
In file included from lib/actions/rs_actioninterface.cpp:27:
In file included from lib/gui/rs_graphicview.h:34:
In file included from /usr/local/Cellar/qt@5/5.15.9/lib/QtWidgets.framework/Headers/QAction:1:
In file included from /usr/local/Cellar/qt@5/5.15.9/lib/QtWidgets.framework/Headers/qaction.h:43:
In file included from /usr/local/include/QtWidgets/qtwidgetsglobal.h:7:
In file included from /usr/local/include/QtGui/qtguiglobal.h:7:
/usr/local/include/QtCore/qglobal.h:106:6: error:
      "Qt requires a C++17 compiler"
#    error "Qt requires a C++17 compiler"
     ^
Reply | Threaded
Open this post in threaded view
|

Re: Xcode 12.4 requires c++17?

dxli
My qglobal.h for Qt-5.15.9 doesn't require C++17.

Anyway, please try c++17:

in the LibreCAD top folder, edit the file common.pri

from

QMAKE_CFLAGS = -std=c++1y

to


QMAKE_CFLAGS = -std=c++1z


kenr wrote
I thought to download and build LibreCAD on my iMac today, 6/12/2023.  This encountered a problem looking for C++17 as shown below.  I am running OS X version 10.15.7 (Catalina) which is the latest available to me on this old machine.  I am running the latest Xcode also available to me which appears to be c++17 compliant.
About xcode shows  Version 12.4 (12D4e)

I feel this ought to work and that I am not selecting the proper compiler.  

Could that be?

Should I try to fall back to an earlier LibreCAD, or try something else?

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=c++1y -O2 -std=gnu++1y  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -Wall -Wextra -fPIC -DDWGSUPPORT -DQC_APPDIR="LibreCAD" -DLC_VERSION="2.2.0-alpha" -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/local/include -I../../libraries/muparser/include -I../../libraries/libdxfrw/src -I../../libraries/jwwlib/src -Icmd -Ilib/actions -Ilib/creation -Ilib/debug -Ilib/engine -Ilib/fileio -Ilib/filters -Ilib/generators -Ilib/gui -Ilib/information -Ilib/math -Ilib/modification -Ilib/printing -Iactions -Imain -Imain/console_dxf2pdf -Itest -Iplugins -Iui -Iui/forms -Iui/generic -I../res -I/usr/local/Cellar/qt@5/5.15.9/lib/QtSvg.framework/Headers -I/usr/local/Cellar/qt@5/5.15.9/lib/QtPrintSupport.framework/Headers -I/usr/local/Cellar/qt@5/5.15.9/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt@5/5.15.9/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt@5/5.15.9/lib/QtCore.framework/Headers -I../../generated/librecad/moc -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AGL.framework/Headers -I../../generated/librecad/ui -I/usr/local/Cellar/qt@5/5.15.9/mkspecs/macx-clang -F/usr/local/Cellar/qt@5/5.15.9/lib -o ../../generated/librecad/obj/rs_snapper.o lib/actions/rs_snapper.cpp
In file included from lib/actions/rs_actioninterface.cpp:27:
In file included from lib/gui/rs_graphicview.h:34:
In file included from /usr/local/Cellar/qt@5/5.15.9/lib/QtWidgets.framework/Headers/QAction:1:
In file included from /usr/local/Cellar/qt@5/5.15.9/lib/QtWidgets.framework/Headers/qaction.h:43:
In file included from /usr/local/include/QtWidgets/qtwidgetsglobal.h:7:
In file included from /usr/local/include/QtGui/qtguiglobal.h:7:
/usr/local/include/QtCore/qglobal.h:106:6: error:
      "Qt requires a C++17 compiler"
#    error "Qt requires a C++17 compiler"
     ^
Reply | Threaded
Open this post in threaded view
|

Re: Xcode 12.4 requires c++17?

ken rector
This post was updated on .
@dixli, Before I saw your previous post I looked again at a stackoverflow item that suggested the problem might be the presence of both QT and QT@5.  I did a brew uninstall QT.  The make proceeded a little further but then stopped with a different error.  

At that point I saw your previous post and set

QMAKE_CFLAGS = -std=c++1z

After a make clean the make finished and produced LibreCAD.app.

Should there be something about this in the build instructions?
Doesn't c++1y cause the inconsistent error even with the c17 compiler?
Reply | Threaded
Open this post in threaded view
|

Re: Xcode 12.4 requires c++17?

dxli
I'm still not clear why your qglobal.h (which is used by every Qt) requires c++17.

c++14 is needed, and c++17 works fine, but we don't want c++14 to break.

ken rector wrote
@dixli, Before I saw your previous post I looked again at a stackoverflow item that suggested the problem might be the presence of both QT and QT@5.  I did a brew uninstall QT.  The make proceeded a little further but then stopped with a different error.  

At that point I saw your previous post and set

QMAKE_CFLAGS = -std=c++1z

After a make clean the make finished and produced LibreCAD.app.

Should there be something about this in the build instructions?
Doesn't c++1y cause the inconsistent error even with the c17 compiler?