无法在qtcreator中编译Qt项目
Unable to Compile a Qt project in qtcreator
我无法编译一个简单的Qt项目(与主窗口的一个例子)。我通过命令shell和QtCreator尝试了它。首先,qmake应该使用命令规则创建makefile,以便将我的UI简单地转换为。h。
Qt Creator在控制台上显示以下警告/错误消息。
09:06:30: Running steps for project untitled...
09:06:30: Starting: "D:QTqt-everywhere-opensource-src-5.6.0qtbasebinqmake.exe" C:workspace_llb_27-05-2016untitleduntitled.pro -r -spec win32-g++
09:06:32: The process "D:QTqt-everywhere-opensource-src-5.6.0qtbasebinqmake.exe" exited normally.
09:06:32: Starting: "C:mingwmingwx64_481r0-sjlj-rev2binmingw32-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:mingwmingwx64_481r0-sjlj-rev2binmingw32-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"
谢谢
我终于找到解决办法了。如果发生在我身上,也可能发生在任何人身上。实际上,在我安装gitbash之前,一切都工作了。我将gitbash的bin设置为变量system到我的路径系统。但是gitbach包含sh.exe这个unix工具。所以每次我通过Qtcreator或console 2构建时,uic_wrapper都被创建了一个。sh一个。bat,我所有的makefile都像unix一样。简而言之,永远不要在你的WINDOWS系统上设置任何UNIX工具。Mingw可以遏制MSYS,保重!!至少大多数面向开发的工具都是类似UNIX的。
我怀疑你的桌面套件可能有问题。我试着创建一个新的默认mainwindow
项目,就像你做的那样,我看到了下面的前几个步骤:
14:48:15: Running steps for project untitled...
14:48:15: Starting: "D:QtQt5.6.05.6mingw49_32binqmake.exe" C:untitleduntitled.pro -r -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
14:48:16: The process "D:QtQt5.6.05.6mingw49_32binqmake.exe" exited normally.
14:48:16: Starting: "D:QtQt5.6.0Toolsmingw492_32binmingw32-make.exe"
D:/Qt/Qt5.6.0/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
您可以注意到我的应用程序与您的应用程序使用的qmake
路径之间存在差异。
Mine looks like this: D:QtQt5.6.05.6mingw49_32binqmake.exe
Yours looks like this: D:QTqt-everywhere-opensource-src-5.6.0qtbasebinqmake.exe
我猜qt-everywhere-opensource-src-5.6.0
看起来像Qt源代码,你可能已经从网络上拉。希望这些信息能给你一些提示,帮助你找出问题所在。
相关文章:
- 使用 Bazel 编译 QT 应用程序时访问资源
- 如何使用MinGW编译器和SSL支持静态编译Qt
- 我可以在不使用Qt for Webassembly的情况下使用Emscripten编译Qt吗?
- 在 centos 7 上编译 Qt 5.11.1 中的错误
- 使用其他编译器编译QT代码
- 为arm64-v8a编译Qt和OpenCV
- C++编译Qt for Visual Studio 2017的问题
- 编译Qt项目,得到错误QQmlEngine:没有这样的文件或目录编译终止
- 编译Qt项目给出了对运算符delete(void*,unsigned int)的未定义引用
- Qt项目与自定义共享库交叉编译Qt
- 交叉编译 qt:加载共享库时出错
- 交叉编译Qt模块(不构建完全全新构建)并添加到现有Qt中
- 如何静态编译QT 5应用程序
- 无法编译QT创建快速应用程序项目
- 编译 Qt 安装程序框架静态
- 如何在QT Creator开源版本中为嵌入式Linux交叉编译qt
- 尝试在代码块中编译 Qt/C++ 代码
- 我可以在编译Qt应用程序的同时忽略Qt的打包库吗?
- 使用 Qt (Ubuntu 14.04) 编译 qt-dab 时出错
- 无法使用qlogvalueaxis.h编译Qt项目