尝试使用VS-addin for Qt在Visual 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 "releaseXXXXXXXXXXXXX.lastbuildstate".
1>InitializeBuildStatus:
1> Touching "releaseXXXXXXXXXXXXX.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)MSBuildMicrosoft.Cppv4.0Microsoft.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) 的处理方法是简单地避免在项目路径和文件名中使用空格。