2014-06-27 67 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/