MS Visual c++ "The number of source files and corresponding outputs must match"



我正试图在msVisual2019中用c++编译我的代码,但每次尝试都会出错:

Severity Code Description Project File Line Suppression State Error MSB6001 Invalid command line switch for "CL.exe". System.ArgumentException: The number of source files and corresponding outputs must match. at Microsoft.Build.Shared.ErrorUtilities.ThrowArgument(Exception innerException, String resourceName, Object[] args) at Microsoft.Build.Utilities.CanonicalTrackedOutputFiles.RemoveDependenciesFromEntryIfMissing(ITaskItem[] source, ITaskItem[] correspondingOutputs) at Microsoft.Build.CPPTasks.CL.PostExecuteTool(Int32 exitCode) at Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) at Microsoft.Build.Utilities.ToolTask.Execute() HelloWorld C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildMicrosoftVCv160Microsoft.CppCommon.targets 687

这首先发生在我(偶然(在";源文件";(img附后(,编译它,然后意识到我的错误,并将它放回"头文件";。现在,每次我构建它,即使在我做了每一次更改之后。。。我无法消除这个错误,而且还没有找到类似问题的解决方案。任何帮助都将不胜感激,谢谢。

[mistake, build after][1]
[correction, build after][2]
[errors displayed][3]
[1]: https://i.stack.imgur.com/SDAzP.png
[2]: https://i.stack.imgur.com/PG54S.png
[3]: https://i.stack.imgur.com/ZhEsH.png

根据文件的描述,预处理文件似乎不是一个好主意:此选项禁止编译。。。我很高兴你把它定在7月10日21:04的rturrado号谢谢@rturrado:D

最新更新