From ac03a3c1043cb21785c53c8acd50c6dd71a2e5f0 Mon Sep 17 00:00:00 2001 From: Jim DeLaHunt Date: Tue, 25 May 2021 23:28:20 -0700 Subject: [PATCH] Fix compile error for Qt clients on macOS, FC_QT5_CXXFLAGS -std=c++11 In m4/qt5-darwin.m4, add flag " -std=c++11" to test and to definition of FC_QT5_CXXFLAGS . This fixes a compilation error on macOS. macOS 10.13.6 High Sierra uses the Apple LLVM version 10.0.0 (clang-1000.11.45.5) compiler, rather than gcc. This compiler conforms to the c++98 standard by default, while gcc conforms to the c++11 standard. The Qt5 code requires features from the c++11 standard. "-std=c++11" makes the clang compiler conform to the correct standard. --- m4/qt5-darwin.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/qt5-darwin.m4 b/m4/qt5-darwin.m4 index 9a0b57c7f2..6d185651da 100644 --- a/m4/qt5-darwin.m4 +++ b/m4/qt5-darwin.m4 @@ -54,12 +54,12 @@ AC_DEFUN([FC_QT5_DARWIN_COMPILETEST], [qt5_headers=yes FC_QT5_CPPFLAGS="${FC_QT5_CPPFLAGS}${CPPFADD}"], [CXXFLAGS_SAVE="${CXXFLAGS}" - CXXFLAGS="${CXXFLAGS} -fPIC" + CXXFLAGS="${CXXFLAGS} -fPIC -std=c++11" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int a; QApplication app(a, 0);]])], [qt5_headers=yes FC_QT5_CPPFLAGS="${FC_QT5_CPPFLAGS}${CPPFADD}" - FC_QT5_CXXFLAGS="${FC_QT5_CXXFLAGS} -fPIC"]) + FC_QT5_CXXFLAGS="${FC_QT5_CXXFLAGS} -fPIC -std=c++11"]) CXXFLAGS="${CXXFLAGS_SAVE}"]) CPPFLAGS="$CPPFLAGS_SAVE" -- 2.31.1