我正在尝试从源代码编译Qt,但在灌输过程中出现错误:
In file included from ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastAllocBase.h:84,
from ../3rdparty/javascriptcore/JavaScriptCore/wtf/HashCountedSet.h:25,
from ../3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h:27,
from ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSCell.h:26,
from ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSAPIValueWrapper.h:28,
from ../3rdparty/javascriptcore/JavaScriptCore/API/APICast.h:29,
from ../3rdparty/javascriptcore/JavaScriptCore/API/JSBase.cpp:30:
../3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:173:69: error: ‘std::tr1’ has not been declared
template<typename T> struct HasTrivialConstructor : public std::tr1::has_trivial_constructor<T> { };
这是编译器问题吗?
你的答案在这里:
使用默认启用的 MinGW/gcc 时会出现此问题 C++11功能,例如更新的Nuwen MinGW构建。
直到 JavaScriptCore 更新以处理 gcc 的标准 C++ 11 支持,它必须在未启用 C++ 11 的情况下构建。
将 mkspecs\win32-g++\qmake.conf 更改为具有以下行:
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -std=gnu++98
允许 JavaScriptCore 构建。