在Windows上从源代码构建Qt5失败

时间:2015-02-22 16:33:08

标签: c++ qt qt5

由于我想静态构建我的Windows版Qt5应用程序(C ++),我从git下载了Qt5的源代码。安装了所有依赖项,如Python,Perl等。当我运行以下命令时

configure.bat -static -opensource -release -nomake examples -nomake tests -platform win32-g++ -c++11 -opengl desktop -no-icu -skip qtwebkit

一切都很好,配置程序说" Qt现在配置为构建。只需运行mingw32-make。"

当我按要求执行时,它会运行几分钟,但最后会导致跟随错误。

 mingw32-make[4]: Entering directory 'c:/Users/lmh/Desktop/proj/QT/qt5-real/qtbas
e/src/tools/moc'
g++ -Wl,--gc-sections -Wl,-s,--gc-sections -Wl,-subsystem,console -o ../../../bi
n/moc.exe .obj/release/moc.o .obj/release/preprocessor.o .obj/release/generator.
o .obj/release/parser.o .obj/release/token.o .obj/release/main.o  -LC:/Users/lmh
/Desktop/proj/QT/qt5-real/qtbase/lib -lQt5Bootstrap -luser32 -lole32 -ladvapi32
-lshell32 -lz
C:/Users/lmh/Desktop/proj/QT/qt5-real/qtbase/lib/libQt5Bootstrap.a: could not re
ad symbols: Archive has no index; run ranlib to add one
collect2.exe: error: ld returned 1 exit status
Makefile.Release:100: recipe for target '../../../bin/moc.exe' failed
mingw32-make[4]: *** [../../../bin/moc.exe] Error 1
mingw32-make[4]: Leaving directory 'c:/Users/lmh/Desktop/proj/QT/qt5-real/qtbase
/src/tools/moc'
Makefile:34: recipe for target 'release' failed
mingw32-make[3]: *** [release] Error 2
mingw32-make[3]: Leaving directory 'c:/Users/lmh/Desktop/proj/QT/qt5-real/qtbase
/src/tools/moc'
Makefile:84: recipe for target 'sub-moc-make_first' failed
mingw32-make[2]: *** [sub-moc-make_first] Error 2
mingw32-make[2]: Leaving directory 'c:/Users/lmh/Desktop/proj/QT/qt5-real/qtbase
/src'
Makefile:41: recipe for target 'sub-src-make_first' failed
mingw32-make[1]: *** [sub-src-make_first] Error 2
mingw32-make[1]: Leaving directory 'c:/Users/lmh/Desktop/proj/QT/qt5-real/qtbase
'
Makefile:50: recipe for target 'module-qtbase-make_first' failed
mingw32-make: *** [module-qtbase-make_first] Error 2

之前有没有人遇到过类似的问题?我在Linux上使用类似的方法来编译源码,我不明白为什么它在Windows上失败了。我很高兴知道我的方法有什么问题。非常感谢你。

0 个答案:

没有答案