5

我正在构建一个从以前的开发人员那里获得的 C++ 项目。当我尝试编译它时,我收到了这个错误(我使用的是 VS2012 Professional):

 \bin\rcc.exe -name resources resources.qrc -o debug\qrc_resources.cpp
 1>  Moc'ing aboutdialog.h...
 1>  The system cannot find the path specified.
 1>  Moc'ing action.h...
 1>  UIC aboutdialog.ui
 1>  The system cannot find the path specified.
 1>  UIC mainwindow.ui
 1>  The system cannot find the path specified.
 1>  RCC resources.qrc
 1>  The system cannot find the path specified.
 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(172,5): error MSB6006: "cmd.exe" exited with code 3.
 1>Done executing task "CustomBuild" -- FAILED.
 1>Done building target "CustomBuild" in project "sv.vcxproj" -- FAILED.

有什么问题,我该如何解决?

4

2 回答 2

2

The project is using Custom Build Steps that depend on the Qt library and its tools. You need to at least download and install Qt (most likely version 4.8, Qt 5 was just released), and maybe also the Qt add-on that is available for Visual C++.

http://qt-project.org/downloads

于 2013-02-25T22:58:52.503 回答
0

我有同样的问题,但我的情况有点不同:

  1. VS2015(已安装QT插件)
  2. QT SDK 安装和配置

这个问题发生在我身上,因为我在我的解决方案文件夹上做了一个“git clean -fdx”,这删除了所有的 moc 文件,因为它们被添加到了 gitignore。

要重新生成 MOC 文件,我必须:

  1. 关闭VS2015
  2. 重新打开解决方案
  3. 重建

完成此操作后,moc 文件重新生成,我可以正确构建,但应用程序无法启动。

于 2017-11-23T18:53:25.243 回答