Windows 8 中的 Dev C:gcc 内部错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12811762/
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
Dev C in Windows 8: gcc Internal Error
提问by boddie
I am a teacher's assistant for a C programming class, and the instructor uses Dev C++ as the compiler for the class. Personally I would use a different one, but the choice is not mine here. Recently I installed the Windows 8 Professional 64 bit that is available on Dreamspark though my university, so I can start with some metro app development for some contests. Unfortunately, Dev C++ has stopped compiling. It previously worked fine with Windows 7 64 bit.
我是C编程课的助教,导师使用Dev C++作为这门课的编译器。就个人而言,我会使用不同的方法,但这里不是我的选择。最近,我通过我的大学安装了 Dreamspark 上可用的 Windows 8 Professional 64 位,因此我可以开始为某些比赛开发一些 Metro 应用程序。不幸的是,Dev C++ 已停止编译。它以前在 Windows 7 64 位上运行良好。
I get an error when compiling that reports back:
编译报告时出现错误:
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\Users\James\Documents\Homework\TA_CPRE_185\counter.c" -o "C:\Users\James\Documents\Homework\TA_CPRE_185\counter.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
gcc.exe: Internal error: Aborted (program collect2)
Please submit a full bug report.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.
Execution terminated
Compilation successful
It says the compilation is successful but it is not, so no executable is made. I want to know if anyone has any ideas of what might get Dev C++ to work on this version of Windows, so I don't have to run Dev C++ in a virtual machine? I need it working, so I can do class demonstrations.
它说编译成功,但事实并非如此,因此没有生成可执行文件。我想知道是否有人对什么可能让 Dev C++ 在这个版本的 Windows 上工作有任何想法,所以我不必在虚拟机中运行 Dev C++?我需要它工作,所以我可以做课堂演示。
采纳答案by Michael Burr
I believe that Dev-C++ comes with a very old version of MinGW (3.4.x if I'm not mistaken). MinGW versions before 4.2.2 will have problems compiling programs on Windows Vista and later unless they are on the PATH.
我相信 Dev-C++ 带有一个非常旧版本的 MinGW(如果我没记错的话,是 3.4.x)。4.2.2 之前的 MinGW 版本在 Windows Vista 和更高版本上编译程序时会出现问题,除非它们在 PATH 上。
So you can either update your version of MinGW (as you mentioned in a comment that you have already done), or you can add the MinGW\bin directory to the system path.
因此,您可以更新您的 MinGW 版本(正如您在已经完成的评论中提到的那样),或者您可以将 MinGW\bin 目录添加到系统路径中。
回答by Orwell
Please tell your teacher to update Dev-C++ instead:
请告诉您的老师更新 Dev-C++:
http://sourceforge.net/projects/orwelldevcpp/?source=directory
http://sourceforge.net/projects/orwelldevcpp/?source=directory
This one ships with a working MinGW 4.7 or a TDM-GCC 4.6.1 (x64) compiler, fixes endless amounts of bugs, and is also portable.
这个附带了一个有效的 MinGW 4.7 或一个 TDM-GCC 4.6.1 (x64) 编译器,修复了无数的错误,而且是可移植的。
回答by Doug
I received the same error, but was able to get around it by doing the following.
我收到了同样的错误,但能够通过执行以下操作来解决它。
- Remove application using add/remove programs
- Disable user access controls
- Reboot
- Download Dev-Cpp 5.4.0 TDM-GCC x64 4.7.1 Setup.exe
- Right-click on downloaded file and change to "win7 compatability mode" for all users and select "run as administrator" and click "OK".
- Right-click downloaded file and choose "run as an administrator" (note: this shouldn't be necessary, but it's windows so cover your bases)
- Choose all the defaults, but on the last screen, deselect "run Dev C++ now" and then select "finish"
- Open windows explorer and browse to the install directory C:\Program Files (x86)\Dev-Cpp and locate "devcpp.exe"; right click and choose "win7 compatability mode" for all users and select "run as administrator" and click "OK" (again, this is probably not necessary, but it doesn't hurt anything either).
- Double-click the application and pin to your taskbar for ease of use.
- Open a new project and test it out, it should work w/o issue.
- 使用添加/删除程序删除应用程序
- 禁用用户访问控制
- 重启
- 下载 Dev-Cpp 5.4.0 TDM-GCC x64 4.7.1 Setup.exe
- 右键单击下载的文件并更改所有用户的“win7 兼容模式”并选择“以管理员身份运行”,然后单击“确定”。
- 右键单击下载的文件并选择“以管理员身份运行”(注意:这应该不是必需的,但它是窗口,因此覆盖了您的基础)
- 选择所有默认值,但在最后一个屏幕上,取消选择“立即运行 Dev C++”,然后选择“完成”
- 打开windows资源管理器,浏览到安装目录C:\Program Files (x86)\Dev-Cpp,找到“devcpp.exe”;右键单击并为所有用户选择“win7 兼容模式”,然后选择“以管理员身份运行”并单击“确定”(同样,这可能没有必要,但也没有任何伤害)。
- 双击应用程序并将其固定到任务栏以方便使用。
- 打开一个新项目并对其进行测试,它应该可以正常工作,没有问题。
回答by GOoOGle
If you cannot change your MINGW version, you can try to rename the following file : MinGW\libexec\gcc\mingw32\3.4.2\collect2.exe to collect2.exe.old
如果您无法更改 MINGW 版本,您可以尝试将以下文件重命名:MinGW\libexec\gcc\mingw32\3.4.2\collect2.exe 到 collect2.exe.old
(this solution worked after a migration from W7 to W10).
(此解决方案在从 W7 迁移到 W10 后有效)。
回答by Sergio Rodríguez González
I used MinGW Installation Managerto download the last version of C Compiler (5.3.0-3 at this moment) and I repliced the files in the folder of Dev-Cpp. Now, its working perfectly in my Windows 10.
我使用MinGW安装管理器下载了最新版本的C编译器(此时为5.3.0-3),并复制了Dev-Cpp文件夹中的文件。现在,它在我的 Windows 10 中完美运行。