【问题标题】:Qt + VS2010: moc: Too many input files specifiedQt + VS2010:moc:指定的输入文件太多
【发布时间】:2012-05-14 16:16:18
【问题描述】:

尝试在 Visual Studio 中使用 Qt 的 VS-addin 编译我的简单 Qt 应用程序,我收到以下错误:

1>------ Rebuild All started: Project: XXXXXXXXXXXXX, Configuration: Release Win32 ------
1>Build started 5/05/2012 6:57:33 PM.
1>_PrepareForClean:
1>  Deleting file "release\XXXXXXXXXXXXX.lastbuildstate".
1>InitializeBuildStatus:
1>  Touching "release\XXXXXXXXXXXXX.unsuccessfulbuild".
1>CustomBuild:
1>  MOC XXXXXXXXXXXXXMainWidget.h
1>  moc: Too many input files specified
1>  Usage: moc [options] <header-file>
1>    -o<file>           write output to file rather than stdout
1>    -I<dir>            add dir to the include path for header files
1>    -E                 preprocess only; do not generate meta object code
1>    -D<macro>[=<def>]  define macro, with optional definition
1>    -U<macro>          undefine macro
1>    -i                 do not generate an #include statement
1>    -p<path>           path prefix for included file
1>    -f[<file>]         force #include, optional file name
1>    -nn                do not display notes
1>    -nw                do not display warnings
1>    @<file>            read additional options from file
1>    -v                 display version of moc
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5):                       error MSB6006: "cmd.exe" exited with code 1.
 1>
 1>Build FAILED.
 1>
 1>Time Elapsed 00:00:00.05
 ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

有什么关系?我用谷歌搜索,问题似乎是 1.1.7 中的错误。解决方案是重新调整 VS 项目中的包含。也就是说,我更愿意继续使用 1.1.10 - 它只有一个月大,我确信问题出在其他地方。

【问题讨论】:

  • 看起来是这样,即使在路径中没有空格的 qmake remade 之后 - 它似乎仍然存在。我会删除一些东西再试一次。
  • 是的。这是捡起一个在路径中有空格的旧环境变量。如果您将此作为回复提交,我会将其标记为您的回复。 :)

标签: visual-studio-2010 qt qt-vs-addin


【解决方案1】:

如果文件名或路径中有空格,就会发生这种情况。

可能有某种形式的引用的变通方法,但处理此问题的最明智 (IMO) 方法是简单地避免在项目路径和文件名中使用空格。

【讨论】:

  • 当你没有给项目命名时;然后呢?
猜你喜欢
  • 2020-11-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-02-26
  • 1970-01-01
  • 2010-11-23
  • 1970-01-01
  • 2012-06-29
相关资源
最近更新 更多