【发布时间】:2016-06-30 07:10:02
【问题描述】:
我无法编译一个简单的 Qt 项目(带有主窗口的示例)。我通过命令外壳和 QtCreator 进行了尝试。首先 qmake 应该使用命令规则 uic 创建 makefile 以将我的 ui 转换为 .h 一样简单。
Qt Creator 在控制台上显示以下警告/错误消息。
09:06:30: Running steps for project untitled...
09:06:30: Starting: "D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe" C:\workspace_llb_27-05-2016\untitled\untitled.pro -r -spec win32-g++
09:06:32: The process "D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe" exited normally.
09:06:32: Starting: "C:\mingw\mingwx64_481r0-sjlj-rev2\bin\mingw32-make.exe"
C:/mingw/mingwx64_481r0-sjlj-rev2/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug'
/C/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug/uic_wrapper.sh ../workspace_llb_27-05-2016/untitled/mainwindow.ui -o ui_mainwindow.h
Makefile.Debug:318: recipe for target 'ui_mainwindow.h' failed
process_begin: CreateProcess(NULL, /C/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug/uic_wrapper.sh ../workspace_llb_27-05-2016/untitled/mainwindow.ui -o ui_mainwindow.h, ...) failed.
make (e=2): Le fichier spécifié est introuvable.
mingw32-make[1]: *** [ui_mainwindow.h] Error 2
mingw32-make[1]: Leaving directory 'C:/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
09:06:33: The process "C:\mingw\mingwx64_481r0-sjlj-rev2\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project untitled (kit: Qt 5.6.0 (Built by mingwx64_481r0-sjlj-rev2))
When executing step "Make"
谢谢
【问题讨论】:
-
由于某种原因,它看起来像 ui_mainwindow.h 不存在,可能 uic_wrapper 无法生成它。我建议尝试仅单独编译 mainwindow.ui,看看是否可行。
-
感谢您的回复马可。它似乎不起作用。我打开命令提示符,在那里我得到了 ui_wrapper.bat 和我的 mainwindow.ui 然后我运行命令行 uic_wrapper.bat -o mainwindow.ui ui_mainwindow.h 但它不起作用,它应该是调用 uic.exe 的生成文件