2016-06-18 24 views
8

Próbowałem skompilować najnowszy kafelki z kodu źródłowego zgodnie z instrukcjami w README.mdQt wymaga wsparcia C++ 11”zrobić błąd

Moje środowisko pracy.

kod źródłowy kaflowy: kafelki-0,16. 1

Mac OS: 10.11.1

Xcode 7.1

QMake: 3,0

Qt: 5.7.0

Jabłko LLVM: 7.0.0

Ale marka nie powiodło się z powodu następującego błędu:

In file included from pythonplugin.cpp:21: 
In file included from ./pythonplugin.h:30: 
In file included from ../../libtiled/logginginterface.h:33: 
In file included from ../../libtiled/tiled_global.h:32: 
In file included from /Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qglobal.h:1145: 
In file included from /Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qatomic.h:46: 
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:61:4: error: "Qt requires C++11 support" 
# error "Qt requires C++11 support" 
^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:90:13: error: unknown type name 'QAtomicOps' 
    typedef QAtomicOps<T> Ops; 
      ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:90:23: error: expected member name or ';' after declaration 
     specifiers 
    typedef QAtomicOps<T> Ops; 
    ~~~~~~~~~~~~~~~~~~^ 
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:93:23: error: use of undeclared identifier 'QAtomicOpsSupport' 
    Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform"); 
        ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qglobal.h:746:66: note: expanded from macro 'Q_STATIC_ASSERT_X' 
#define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) 
                   ^
In file included from pythonplugin.cpp:21: 
In file included from ./pythonplugin.h:30: 
In file included from ../../libtiled/logginginterface.h:33: 
In file included from ../../libtiled/tiled_global.h:32: 
In file included from /Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qglobal.h:1145: 
In file included from /Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qatomic.h:46: 
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:93:53: error: no member named 'IsSupported' in the global 
     namespace 
    Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform"); 
                ~~^ 
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qglobal.h:746:66: note: expanded from macro 'Q_STATIC_ASSERT_X' 
#define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) 
                   ^
In file included from pythonplugin.cpp:21: 
In file included from ./pythonplugin.h:30: 
In file included from ../../libtiled/logginginterface.h:33: 
In file included from ../../libtiled/tiled_global.h:32: 
In file included from /Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qglobal.h:1145: 
In file included from /Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qatomic.h:46: 
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:95:14: error: use of undeclared identifier 'Ops' 
    typename Ops::Type _q_value; 
      ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:95:19: error: expected a qualified name after 'typename' 
    typename Ops::Type _q_value; 
       ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:95:23: error: expected ';' at end of declaration list 
    typename Ops::Type _q_value; 
        ^
         ; 
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:99:44: error: use of undeclared identifier 'Ops' 
    T load() const Q_DECL_NOTHROW { return Ops::load(_q_value); } 
             ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:99:54: error: use of undeclared identifier '_q_value' 
    T load() const Q_DECL_NOTHROW { return Ops::load(_q_value); } 
                ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:100:45: error: use of undeclared identifier 'Ops' 
    void store(T newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); } 
              ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:100:56: error: use of undeclared identifier '_q_value' 
    void store(T newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); } 
                ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:102:51: error: use of undeclared identifier 'Ops' 
    T loadAcquire() const Q_DECL_NOTHROW { return Ops::loadAcquire(_q_value); } 
               ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:102:68: error: use of undeclared identifier '_q_value' 
    T loadAcquire() const Q_DECL_NOTHROW { return Ops::loadAcquire(_q_value); } 
                   ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:103:52: error: use of undeclared identifier 'Ops' 
    void storeRelease(T newValue) Q_DECL_NOTHROW { Ops::storeRelease(_q_value, newValue); } 
               ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:103:70: error: use of undeclared identifier '_q_value' 
    void storeRelease(T newValue) Q_DECL_NOTHROW { Ops::storeRelease(_q_value, newValue); } 
                    ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:107:86: error: use of undeclared identifier 'Ops' 
    static Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return Ops::isReferenceCountingNative(); } 
                        ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:107:34: error: no return statement in constexpr function 
    static Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return Ops::isReferenceCountingNative(); } 
           ^
/Users/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qbasicatomic.h:108:88: error: use of undeclared identifier 'Ops' 
    static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return Ops::isReferenceCountingWaitFree(); } 
                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=] 
20 errors generated. 
make[3]: *** [pythonplugin.o] Error 1 
make[2]: *** [sub-python-make_first] Error 2 
make[1]: *** [sub-plugins-make_first-ordered] Error 2 
make: *** [sub-src-make_first-ordered] Error 2 

Po robi rozeznanie, starałem się dodać linię do CONFIG+= c++11 plik tiled.pro a następnie dokonać czystej, qmake, należy jednak nadal mam ten sam błąd ......

tiled.pro:

# Check the Qt version. If QT_VERSION is not set, it is probably Qt 3. 
isEmpty(QT_VERSION) { 
    error("QT_VERSION not defined. Tiled does not work with Qt 3.") 
} 

include(tiled.pri) 

!minQtVersion(5, 1, 0) { 
    message("Cannot build Tiled with Qt version $${QT_VERSION}") 
    error("Use at least Qt 5.1.0.") 
} 

TEMPLATE = subdirs 
CONFIG += ordered 
CONFIG += c++11 

SUBDIRS = src translations 

Nie jestem pewien, co tu jest nie tak.

Wszelkie porady będą mile widziane, dzięki :)

UPDATE:

Tried

QMAKE_CXXFLAGS += -std=c++11 

i

QMAKE_CXXFLAGS += -std=c++0x 

Nadal masz ten sam błąd ......

Pomyślałem, że może to być w C++ skompilować użyć polecenia make, tutaj jest kilka informacji:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c `python-config --cflags` -O2 -std=gnu++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.8 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DPYTHON_LIBRARY -DQT_NO_DEBUG -DQT_PLUGIN -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../libtiled -I/Users/supersuraccoon/Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers -I/Users/supersuraccoon/Qt5.7.0/5.7/clang_64/lib/QtGui.framework/Headers -I/Users/supersuraccoon/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AGL.framework/Headers -I/Users/supersuraccoon/Qt5.7.0/5.7/clang_64/mkspecs/macx-clang -F/Users/supersuraccoon/Qt5.7.0/5.7/clang_64/lib -o pythonplugin.o pythonplugin.cpp 
+0

Wypróbuj także 'QMAKE_CXXFLAGS + = -std = C++ 11' – vsoftco

+0

Spróbuj również' QMAKE_CXXFLAGS + = -std = C++ 0x' – mvidelgauz

+0

Dzięki za szybką odpowiedź wypróbowałem obie flagi, ale nadal mam ten sam błąd. Sprawdź informacje o aktualizacji tego pytania. – supersuraccoon

Odpowiedz

6

miałem podobny problem budowania poppler z owijarki Qt i dostał ten sam błąd: „Qt wymaga C++ 11 wsparcie".

Moja konfiguracja to:

Mac OS: 10.11.5 
Xcode : 7.3.1 
QMake: 3.0 
Qt: 5.7.0 
Apple LLVM: 7.3.0 

Ja tylko:

export CXXFLAGS=-std=c++11 
./configure 
make 

i to działało.

0

Wiem, że minęło trochę czasu. Jak w końcu rozwiązać ten problem dodając CMakeLists.txt następujący wiersz tuż po project(MyProject):

add_compile_options(-std=c++11) 

To mówi do cmake, aby utworzyć Makefile że użyje C++ 11 rozwiązywania problemów.