有什么办法可以阻止 Eclipse CDT 构建?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3639282/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 15:05:02  来源:igfitidea点击:

Any way to stop Eclipse CDT build?

eclipseeclipse-cdt

提问by JnBrymn

I'm attempting to build a project in Eclipse CDT and the build process fails early on, but then takes minutes to finish computing and finally quit.

我正在尝试在 Eclipse CDT 中构建一个项目,但构建过程早期失败,但随后需要几分钟才能完成计算并最终退出。

How, through the Eclipse IDE, can I stop the build process.

如何通过 Eclipse IDE 停止构建过程。

I know there must be some way because I can delete any random file from the Project Explorer and a box pops up with the processes and I can click the red box next to build and it quits. But I shouldn't be required to delete a random file to get that box to pop up. Where is it?

我知道一定有某种方法,因为我可以从项目资源管理器中删除任何随机文件,并且会弹出一个包含进程的框,我可以单击旁边的红色框进行构建并退出。但是我不应该被要求删除一个随机文件来弹出那个框。它在哪里?

回答by JnBrymn

There is a "progress view" found at Windows->Show View->other->General->Progress. That has the little red square I need to stop any particular task.

在 Windows->Show View->other->General->Progress 有一个“进度视图”。那是我需要停止任何特定任务的小红方块。

回答by twokats

FYI - there's also a setting in the Properties sheet to "Stop on first build error".

仅供参考 - 属性表中还有一个设置为“在第一次构建错误时停止”。

Under the C/C++ Builditem in the Properties page, click on the configuration you wish to modify, choose the Behaviortab, and click the checkbox under "Build Settings" ("Stop on first build error").

在Properties 页面的C/C++ Build项下,单击要修改的配置,选择Behavior选项卡,然后单击“Build Settings”下的复选框(“Stop on first build error”)。

You can still use John's method to stop the build at any time, but if you're looking to have the build stop when you first encounter an error instead of continuing on, this setting might be helpful.

您仍然可以随时使用 John 的方法来停止构建,但是如果您希望在首次遇到错误时停止构建而不是继续,则此设置可能会有所帮助。

回答by mrgloom

I use -Wfatal-errorsflag in Makefile in Eclipse to prevent polluting my console

-Wfatal-errors在 Eclipse 的 Makefile 中使用标志来防止污染我的控制台

-Wfatal-errors This option causes the compiler to abort compilation on the first error occurred rather than trying to keep going and printing further error messages. https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Warning-Options.html

-Wfatal-errors 此选项使编译器在发生第一个错误时中止编译,而不是继续尝试并打印更多错误消息。 https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Warning-Options.html

回答by Sendao TheGreat

You can disable the console's annoying focus-stealing behavior both for the build messages (so you can get the progress dialog to stay open) and for your program's console output (when debugging multiple threads). Go to window->preferences->C/C++/Build/Console and you'll find an option "Bring console to top when building (if present)". Uncheck that and you then can pause the build as you wish. To keep your program output chilled you can go here: http://georgik.sinusgear.com/2011/12/22/how-to-disable-stealing-of-focus-by-console-in-eclipse/

您可以为构建消息(这样您可以使进度对话框保持打开状态)和程序的控制台输出(在调试多个线程时)禁用控制台令人讨厌的焦点窃取行为。转到 window->preferences->C/C++/Build/Console,您将找到一个选项“构建时将控制台置于顶部(如果存在)”。取消选中它,然后您可以根据需要暂停构建。为了让你的程序输出保持冷静,你可以去这里:http: //georgik.sinusgear.com/2011/12/22/how-to-disable-stealing-of-focus-by-console-in-eclipse/