I'm going crazy because of Mac OSX and Qt!
-
My Mac OSX machine with the latest version of Mac OS X has worked perfectly with Qt 5.9.2.
But today, after a one month without to compile something with this machine and after some Apple uptades, when i try to compile something with Qt I obtain the error:error: Qt requires a C++11 compiler and yours does not seem to be that.
error: "Qt requires C++11 support"The command line tools are installed and seems to be ok because I can compile an application using Lazarus / Freepascal.
I tryed the lates Qt 5.10.0 but I obtain the same error.What can I do to resolve?
-
@Diracsbracket you too?
-
@mrdebug
Hi,
I've just had a look into the header fileqcompilerdetection.h(see this link) as it is the one raising the error in your screenshot. I searched for your error and found only 1 occurence for it in the file:559 #ifdef __cplusplus 560 # if __cplusplus < 201103L && !defined(Q_CC_MSVC) 561 # error Qt requires a C++11 compiler and yours does not seem to be that. 562 # endif 563 #endifSo, I tried to check the value of
__cplusplusin my case, by putting the following in e.g.main.cpp:#define DISPLAY_VALUE2(x) #x #define DISPLAY_VALUE(x) DISPLAY_VALUE2(x) #pragma message(DISPLAY_VALUE(__cplusplus))It shows that on my system, the value is
201103L, thus OK.
What does it show when you use it?
-
@mrdebug
In addition, the Makefile of my test program has the following line:CXXFLAGS = -pipe -stdlib=libc++ -g -std=gnu++11 $(EXPORT_ARCH_ARGS) -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC $(DEFINES)The interesting part here is
-std=gnu++11.
Would addingQMAKE_CXXFLAGS += -std=gnu++11in your.profile make any difference? -
After may hours spent on searching the solution I have moved the project in another directory. Now the project (without any editing) was been compiled.
After that I have moved the project in its own default directory. After a clean the project was been compiled without any problem. -
What were the paths ?
-
And just moving it fixed the issue ?
-
Strange indeed. Oh well, the essential is that you have it working now.