How to solve "error Qt requires a C++11 compiler and yours does not seem to be that" issue when building Tiled using Qt Creator on windows 7?


(Keshav Sharma) #1

Im running windows 7 32 bit and latest Qt Version, i followed the tiled wiki on github regarding building the source code and after clicking on .qbs file and building it, i received about 37 errors including this

error Qt requires a C++11 compiler and yours does not seem to be that

Several google search suggested me to add QMAKE_CXXFLAGS += -std=c++11 line in tiled.pro file but still it doesn’t work and issue remains the same, anyone here who can please help me ?

EXTRA UPDATE :
I did some blind checks and ran the following code via a completely new project

#include <iostream>

int main(){
        #if __cplusplus==201402L
        std::cout << "C++14" << std::endl;
        #elif __cplusplus==201103L
        std::cout << "C++11" << std::endl;
        #else
        std::cout << "C++" << std::endl;
        #endif

        return 0;
}

The output was “C++11”, idk if this will provide much information to you or not


(Thorbjørn Lindeijer) #2

Which compiler are you using? Tiled is compiling fine against Qt 5.8 with either MinGW or VS 2013, but so far I have not yet moved to Qt 5.9 because of problems with zlib (seems like they removed QtZlib/zlib.h in the MinGW version of Qt 5.9).

I have not encountered any issues with C++11, though.

Note that tiled.pro doesn’t work on Windows, you need to use tiled.qbs. But both projects are already C++11-enabled since a long time.