使用Code :: Blocks IDE时禁止(或显示)弹出控制台 [英] Suppress (or show) popup console when using Code::Blocks IDE

查看:110
本文介绍了使用Code :: Blocks IDE时禁止(或显示)弹出控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GNU GCC上使用 Code :: Blocks 版本13.12编译器.我最近在Windows 7上安装并开始使用这些工具.尽管我不认为语言是一个重要因素,但我使用此环境来创建C和C ++应用程序.

I am using Code::Blocks version 13.12 with the GNU GCC Compiler. I recently installed and started using these tools on Windows 7. Although I do not believe language is a contributing factor, I use this environment to create both C and C++ applications.

在获得调试或发布目标可执行文件的完整构建,并单击绿色的运行"或红色的调试/运行"工具栏按钮后,我什至看到控制台弹出窗口闪烁(出现,然后关闭)用于不向 stdout 写入任何内容的代码.例如...

After getting a clean build for either a debug or release target executable, and click on either the green "Run" or the red "Debug/Run" toolbar button, I see a console popup flicker (appear, then close) even for code that writes nothing to stdout. For example...

int main(void)
{
    int a = 1;
    return 0;
}

...产生一个控制台弹出窗口.

...produces a console popup.

谁能描述如何设置Code :: Blocks IDE来抑制控制台弹出窗口?

Can anyone describe how to set the Code::Blocks IDE to suppress the console popup?

注意:我已经审查了与此问题相关的答案 此处 .这些职位的相关之处在于,其中一个职位作为另一个职位的副本被关闭,但是对于这两个职位的回答均未解决.(即因为我的系统未使用 Avast ,所以Avast完全是与此问题无关)

Note: I have reviewed answers related to this question here and here. These posts are related in that one is closed as a duplicate of the other, but answers for neither address this question. (i.e. Because my systems do not use Avast, Avast is completely unrelated to the issue)

推荐答案

您可以更改Code :: Blocks中的设置以作为GUI应用程序运行.这将告诉它按原样进行编译,并且在启动时不会产生控制台窗口.这就是您的操作方式:

You can change the settings in Code::Blocks to run as a GUI application. This will tell it to compile as such and it will not produce a console window on startup. And this is how you do so:

1. Click Project on the CodeBlocks menu.  
2. Click Properties.  
3. Click the second tab, Build Targets.  
4. On the right, where it says Type: Console application, change it to GUI application.  
5. Rebuild the project.

如果您还有其他问题,这里就是收集信息的地方:如何利用MinGW编译的GUI程序的控制台+代码::阻止

This is where the information was gather if you have further questions: How to get ride of console box of a GUI program compile by MinGW + Code::Block

这篇关于使用Code :: Blocks IDE时禁止(或显示)弹出控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆