visual-studio-2010 - Qt+VS2010 : moc: Too many input files specified

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

尝试使用 Qt 的 VS-addin 在 vi​​sual studio 中编译我的简单 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 - 它只有一个月大,我确信问题出在其他地方。

最佳答案

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

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

关于visual-studio-2010 - Qt+VS2010 : moc: Too many input files specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10460347/

相关文章:

c++ - 有没有办法在所有新的 Qt 项目上强制使用 QT_NO_FOREACH?

iphone - 有什么已知的方法可以通过 USB 数据线(无 wifi)从 iPhone 浏览 PC localhost?

c++ - 使用操作系统定义的默认文件对话框的 QFileDialog 替代方案?

c# - WinApi SendMessage/PostMessage 在我的电脑上不工作?

c++ - Qt GUI 开发 - 使用 QGraphicsView 显示 2D 网格

windows - 编译 Qt 5,收到警告 "The build will most likely fail."

visual-studio - 在MSVC中找不到QTDIR错误构建项目

visual-studio-2010 - UL 标签内的标签 H3

c++ - 将 Mat 转换为 QPixmap