简体   繁体   English

如何使Visual Studio 2013不停止错误构建(C ++)

[英]How to get Visual Studio 2013 to not stop the build on errors (C++)

My Visual Studio 2013 (on Windows 7) stops the C++ build when there are errors without attempting to compile all the files. 如果出现错误而没有尝试编译所有文件,则我的Visual Studio 2013(在Windows 7上)将停止C ++构建。 It will report errors from multiple files, but seems to stop after compiling files in the same project folder if there are errors in those files. 它会报告多个文件中的错误,但是如果这些文件中有错误,则似乎在编译相同项目文件夹中的文件后会停止。 (I can't say for sure that that's what it's doing.) After I correct those errors and build again, it will continue on until it finds errors in another batch of files and then quit again. (我不能肯定地说这就是它的作用。)纠正这些错误并再次构建之后,它将继续进行下去,直到在另一批文件中发现错误,然后再次退出为止。 I can't seem to find any setting that controls this, and I'm pretty sure it's not supposed to be the default behavior. 我似乎找不到任何可以控制此设置的设置,而且我很确定这不是默认行为。

I am well aware that a final build product cannot be produced when there are errors. 我很清楚,有错误时不能生产最终的构建产品。 The goal is not to avoid fixing errors. 目的是避免避免错误。 The goal is to be able to start a build, do something else for a while, come back, and have all errors in the entire project waiting in a list to get fixed at once. 目标是能够开始构建,一段时间后再执行其他操作,再返回,并使整个项目中的所有错误都在列表中等待修复。

The termination of the build process depends on the severity of the defect and the confusion within the compiler. 构建过程的终止取决于缺陷的严重性和编译器内部的混乱。

Some errors are either so severe that the compiler can't continue or there are so many repetitive issues that the compiler gives up. 有些错误要么非常严重,以至于编译器无法继续运行,要么有太多重复性问题被编译器放弃。 The GNU compilers will usually summarize and only issue one notification for repetitive errors or warnings. GNU编译器通常会汇总并仅针对重复的错误或警告发出一个通知。

Some errors will cause the compiler to get confused. 一些错误将导致编译器感到困惑。 The error interfere with how the language is parsed and so the compiler gives up. 该错误干扰了语言的解析方式,因此编译器放弃了。 Many examples are the omission of semicolons, closing braces or closing comments. 许多示例是省略分号,大括号或结束注释。

Other factors may break the build such as missing files, old object files, confused symbol files (many times in Visual Studio). 其他因素可能会破坏生成,例如丢失文件,旧对象文件,混乱的符号文件(在Visual Studio中很多次)。

With Visual Studio you need remove all errors in the project before you can compile. 使用Visual Studio,需要先删除项目中的所有错误,然后才能进行编译。 If you separate the non-compilable files from the project that will allow you to compile as long as you don't need them. 如果将不可编译文件与项目分开,则只要不需要它们,它们都可以进行编译。 If you do need them Then you MUST fix the errors. 如果确实需要它们,则必须更正错误。 Compiler errors are there for a reason. 出现编译器错误是有原因的。 Fix the errors or comment the bad code out. 修复错误或注释掉错误的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM