2014-06-27 68 views
2

我编译后的Qt 5.3和我得到的错误,尤其是这一个:编译后的Qt 5.3失败

error: ‘QV4::Property::Property(const QV4::Property&)’ is private 

我的配置选项有:

./configure -no-compile-examples -no-opengl -no-openssl -no-fontconfig 

这是结果gmake:

make[3]: Entering directory `/home/niko/qt-everywhere-opensource-src-5.3.1/qtdeclarative/src/qml' 
g++ -c -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_INTEGER_EVENT_COORDINATES -DQT_BUILD_QML_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DWTF_EXPORT_PRIVATE= -DJS_EXPORT_PRIVATE= -DWTFReportAssertionFailure=qmlWTFReportAssertionFailure -DWTFReportBacktrace=qmlWTFReportBacktrace -DWTFInvokeCrashHook=qmlWTFInvokeCrashHook -DENABLE_LLINT=0 -DENABLE_DFG_JIT=0 -DENABLE_DFG_JIT_UTILITY_METHODS=1 -DENABLE_JIT_CONSTANT_BLINDING=0 -DBUILDING_QT__ -DWTF_USE_UDIS86=0 -DNDEBUG -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I/home/niko/qt-everywhere-opensource-src-5.3.1/qtbase/mkspecs/linux-g++ -I. -I../../include -I../../include/QtQml -I../../include/QtQml/5.3.1 -I../../include/QtQml/5.3.1/QtQml -Icompiler -I. -I../3rdparty/masm/jit -I../3rdparty/masm/assembler -I../3rdparty/masm/runtime -I../3rdparty/masm/wtf -I../3rdparty/masm/stubs -I../3rdparty/masm/stubs/wtf -I../3rdparty/masm -I../3rdparty/masm/disassembler -I../3rdparty/masm/disassembler/udis86 -Ijit -I. -Ijsruntime -I. -I../3rdparty/double-conversion -Idebugger -Ianimations -I/home/niko/qt-everywhere-opensource-src-5.3.1/qtbase/include -I/home/niko/qt-everywhere-opensource-src-5.3.1/qtbase/include/QtNetwork -I/home/niko/qt-everywhere-opensource-src-5.3.1/qtbase/include/QtCore/5.3.1 -I/home/niko/qt-everywhere-opensource-src-5.3.1/qtbase/include/QtCore/5.3.1/QtCore -I/home/niko/qt-everywhere-opensource-src-5.3.1/qtbase/include/QtCore -I.moc -o .obj/qqmllistaccessor.o util/qqmllistaccessor.cpp 
../../include/QtQml/5.3.1/QtQml/private/../../../../../src/qml/jsruntime/qv4managed_p.h: In constructor ‘QV4::ManagedRef::ManagedRef(const QV4::Scoped<QV4::Managed>&)’: 
../../include/QtQml/5.3.1/QtQml/private/../../../../../src/qml/jsruntime/qv4managed_p.h:364: warning: lowering visibility of ‘QV4::Value* QV4::extractValuePointer(const QV4::Scoped<T>&) [with T = QV4::Managed]’ to match its type 
../../include/QtQml/5.3.1/QtQml/private/../../../../../src/qml/jsruntime/qv4string_p.h: In function ‘QV4::ReturnedValue QV4::value_convert(QV4::ExecutionEngine*, const QV4::Value&) [with T = QV4::String]’: 
../../include/QtQml/5.3.1/QtQml/private/../../../../../src/qml/jsruntime/qv4string_p.h:189: warning: lowering visibility of ‘QV4::ReturnedValue QV4::value_convert(QV4::ExecutionEngine*, const QV4::Value&) [with T = QV4::String]’ to match its type 
../../include/QtQml/5.3.1/QtQml/private/../../../../../src/qml/jsruntime/qv4managed_p.h: In constructor ‘QV4::StringRef::StringRef(const QV4::Scoped<QV4::String>&)’:../../include/QtQml/5.3.1/QtQml/private/../../../../../src/qml/jsruntime/qv4managed_p.h:364: warning: lowering visibility of ‘QV4::Value* QV4::extractValuePointer(const QV4::Scoped<T>&) [with T = QV4::String]’ to match its type 
../../include/QtQml/5.3.1/QtQml/private/../../../../../src/qml/jsruntime/qv4property_p.h: In member function ‘void QV4::Object::insertMember(QV4::StringRef, QV4::ValueRef, QV4::PropertyAttributes)’: 
../../include/QtQml/5.3.1/QtQml/private/../../../../../src/qml/jsruntime/qv4property_p.h:101: error: ‘QV4::Property::Property(const QV4::Property&)’ is private 
../../include/QtQml/5.3.1/QtQml/private/../../../../../src/qml/jsruntime/qv4object_p.h:171: error: within this context 
make[3]: *** [.obj/qqmllistaccessor.o] Error 1 
make[3]: Leaving directory `/home/niko/qt-everywhere-opensource-src-5.3.1/qtdeclarative/src/qml' 
make[2]: *** [sub-qml-make_first-ordered] Error 2 
make[2]: Leaving directory `/home/niko/qt-everywhere-opensource-src-5.3.1/qtdeclarative/src' 
make[1]: *** [sub-src-make_first] Error 2 
make[1]: Leaving directory `/home/niko/qt-everywhere-opensource-src-5.3.1/qtdeclarative' 
make: *** [module-qtdeclarative-make_first] Error 2 
-bash-3.2$ 

我该如何解决?我的系统信息是:

$ g++ -v 
Using built-in specs. 
Target: x86_64-redhat-linux 
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux 
Thread model: posix 
gcc version 4.1.2 20080704 (Red Hat 4.1.2-54) 
$ rpm -qa|grep relea 
redhat-release-5Server-5.9.0.2 
redhat-release-notes-5Server-46 
$ uname -a 
Linux mapserver03 2.6.18-348.el5 #1 SMP Wed Nov 28 21:22:00 EST 2012 x86_64 x86_64 x86_64 GNU/Linux 
$ 
$ pwd 
/home/niko/qt-everywhere-opensource-src-5.3.1 
$ 
+0

使用*至少* GCC 4.6,不少于。 – peppe

回答

3

很可能你的gcc太旧了。你可以通过安装一个新的gcc来解决这个问题(比如从你的$ HOME前缀来源)。

2

这是一个已知的问题和Qt的错误跟踪已报导:

Compile error due to attempt to use private constructor

这可以或可以不被具体取决于问题的根本原因的上游固定的。

也就是说,用gcc 4.1.2(!)构建Qt 5.3是一项非常勇敢的活动。不管这个问题,我建议更新。

编辑:看起来这是在开发版本中修复的,所以你可以将修补程序恢复到你发布的tarball并重试。或者,您可以尝试最新的开发版本。

https://codereview.qt-project.org/#/c/84760/