Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 从源代码编译Qt5.3失败_C++_Qt_Gcc_Qml_Qt5 - Fatal编程技术网

C++ 从源代码编译Qt5.3失败

C++ 从源代码编译Qt5.3失败,c++,qt,gcc,qml,qt5,C++,Qt,Gcc,Qml,Qt5,我是从源代码处编译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-everywh

我是从源代码处编译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$

很可能您的gcc太旧了。您可以通过安装一个更新的gcc(比如从源代码中,在$HOME前缀中)来修复它。

这是一个已知的问题,并且已经在Qt bug跟踪器上报告过:

根据问题的根本原因,这可能在上游修复,也可能不修复

尽管如此,使用GCC4.1.2(!)构建Qt5.3是一项勇敢的活动。我建议不管这个问题如何更新

编辑:这似乎在开发版本中得到了修复,因此您可能可以将该修复向后移植到发布的tarball中,然后重试。或者,您可以尝试最新的开发版本

至少使用GCC 4.6,而不是更少。
$ 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
$