C语言 Code::Blocks 13.12 错误 - CC1.exe 已停止工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27664238/
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-02 11:39:22  来源:igfitidea点击:

Code::Blocks 13.12 error - CC1.exe has stopped working

cerror-handlingcompiler-errorscodeblocks

提问by Rishu

I am using Code::Blocks 13.12 for programming in C. After building and running my simple HelloWorld.c program, it gives an error.

我正在使用 Code::Blocks 13.12 进行 C 编程。在构建并运行我的简单 HelloWorld.c 程序后,它给出了一个错误。

Error: An alert box pop up saying -"cc1.exe has stopped working.A problem caused the program to stop working correctly.Windows will close the program and notify you if a solution is available."

错误:弹出一个警告框说 -“cc1.exe 已停止工作。一个问题导致程序停止正常工作。Windows 将关闭该程序并通知您是否有可用的解决方案。”

I tried using Notepad++ , the same pop up appears saying a.exe has stopped working.

我尝试使用 Notepad++ ,同样的弹出窗口显示 a.exe 已停止工作。

I am a naive,so have no idea on how to deal with this. My queries:

我很天真,所以不知道如何处理这个问题。我的疑问:

1) Am I using an outdated version? If not, how can I get rid of this problem?

1) 我使用的是过时的版本吗?如果没有,我该如何摆脱这个问题?

2) Which is the most efficient IDE available for C/C++ if Code::Blocks is not that efficient? My requirement" -I had been using Turbo C and it doesn't give errors like segmentation fault and other memory related errors that we get in online Compilers or compilers of competitive programming.So, I need an efficient compiler which behaves same as online compilers, so I don't get stuck while solving problems during competitive programming.

2) 如果 Code::Blocks 不是那么有效,哪个是 C/C++ 可用的最有效的 IDE?我的要求”-我一直在使用 Turbo C,它不会给出我们在在线编译器或竞争性编程的编译器中遇到的诸如分段错误和其他与内存相关的错误之类的错误。因此,我需要一个与在线编译器的行为相同的高效编译器,所以我在竞争性编程期间解决问题时不会卡住。

This is the simple code giving error:

这是给出错误的简单代码:

#include <stdio.h>

void main()
{
    printf("Hello world!");
    //return 0;
}

Edit:

编辑:

Even after changing the code to return int, it's giving an error.I tried editing the code as below, but the same window is being popped up again.

即使在将代码更改为返回 int 后,它也会出现错误。我尝试编辑如下代码,但再次弹出相同的窗口。

int main(void)
{
    printf("Hello world!");
    return 0;
}

回答by user4520

There's no problem with your code, though indeed, as pointed out in the comments, neither void main()nor int main(void)is considered correct, but that's not what's causing the problem. cc1.exe is a MinGW-related file (MinGW is the GCC port for Windows that Code::Blocks uses by default for compilation); if it's crashing, it's possible the installation is corrupt.

您的代码没有问题,尽管确实如评论中所指出的那样,既不正确void main()也不int main(void)被认为是正确的,但这不是导致问题的原因。cc1.exe是一个MinGW相关的文件(MinGW是Code::Blocks编译默认使用的Windows的GCC端口);如果它崩溃,则可能是安装已损坏。

I suggest you try reinstalling MinGW - remove Code::Blocks, install the standalone MinGW version, then download Code::Blocks without the compiler suite, install it and configure to use your version of MinGW.

我建议您尝试重新安装 MinGW - 删除 Code::Blocks,安装独立的 MinGW 版本,然后下载没有编译器套件的 Code::Blocks,安装它并配置为使用您的 MinGW 版本。

回答by Rohana

For me, the solution was to choose,

对我来说,解决方案是选择,

Select target -> Release

选择目标 -> 发布

from the Buildmenu. It took lots of time for me to find this!

Build菜单。我花了很多时间才找到这个!