Qt5 - 静态 x64 和链接噩梦

Qt5 -static x64 and linking nightmares

本文关键字:链接 噩梦 x64 静态 Qt5      更新时间:2023-10-16

我正在尝试使用 -static 选项在 Windows 7 64 位下编译 Qt5 64 位。

这是我所做的:

1) 下载 Qt 源代码并将它们解压缩到 C:\Qt5\5.0src 目录中2) 按照此处的所有步骤 http://www.geometrian.com/programming/tutorials/setup_Qt.txt 设置环境变量和 .conf 文件以静态构建3) 启动配置

configure -debug-and-release -opensource -confirm-license -platform win32-msvc2010 -nomake tests -nomake examples -opengl desktop
需要 opengl

桌面参数,因为 -no-opengl 有一个错误,我无法编译角度。

终于启动了 jom.exe -j5/p

我得到了这个我不知道如何解决的错误

moc_qwindowsinputcontext.cpp
        lib /NOLOGO  /OUT:........pluginsplatformsqwindows.lib @C:UsersMarkAppDataLocalTempqwindows.lib.3796.29562.jom
        cd qtsvg && ( if not exist Makefile C:Qt5.0srcqtbasebinqmake C:Qt5.0srcqtsvgqtsvg.pro -o Makefile ) && C:Qt5.0srcj
om.exe -f Makefile
        cd src && ( if not exist Makefile C:Qt5.0srcqtbasebinqmake C:Qt5.0srcqtsvgsrcsrc.pro -o Makefile ) && C:Qt5.0srcj
om.exe -f Makefile
        cd svg && ( if not exist Makefile C:Qt5.0srcqtbasebinqmake C:Qt5.0srcqtsvgsrcsvgsvg.pro -o Makefile ) && C:Qt5.0s
rcjom.exe -f Makefile
        C:Qt5.0srcjom.exe -f Makefile.Debug all
Error: dependent 'C:Qt5.0srcqtbaselibQt5Widgetsd.lib' does not exist.
jom: C:Qt5.0srcqtsvgsrcsvgMakefile [debug-all] Error 2
jom: C:Qt5.0srcqtsvgsrcMakefile [sub-svg-make_first-ordered] Error 2
jom: C:Qt5.0srcqtsvgMakefile [sub-src-make_first] Error 2
jom: C:Qt5.0srcMakefile [module-qtsvg-make_first] Error 2

似乎"Qt5Widgetsd.lib"不存在...为什么?为什么还没有建成?

帮助将不胜感激

我无法解决它,但我发现 -no-opengl 与 Qt5 有问题,所以我切换到 Qt4 并解决了我的问题