使用大型预编译头文件时cc1plus.exe崩溃 [英] cc1plus.exe crash when using large precompiled header file

查看:153
本文介绍了使用大型预编译头文件时cc1plus.exe崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将预编译的头文件与MinGW一起使用时遇到问题.编译器似乎找到了预编译的头文件,但cc1plus.exe在(cc1plus.exe停止工作)后立即崩溃.

I'm having an issue using precompiled header files with MinGW. The compiler seems to find the precompiled header file but cc1plus.exe crashes immediately after (cc1plus.exe has stopped working).

我已经了解到,这可能与cc1plus.exe的堆栈小有关,因此我做了以下操作来增加它:

I've understood that this might be in connection with cc1plus.exe's low stack size, so I did the following to increase it:

editbin cc1plus.exe /STACK 33554432

而且我也无济于事:

editbin cc1plus.exe /STACK 32768k

但这并不能解决问题,因为每当我尝试编译我的应用程序时,它仍然会崩溃.

This however did not solve it as it still keeps crashing whenever I try to compile my application.

如果这很重要,我将使用最新的MinGw(gcc v 4.6.2)和最新的Eclipse CDT.

By the way I'm using the latest MinGw (gcc v 4.6.2) and the latest Eclipse CDT if that matters.

我是否正确地增加了cc1plus.exe的堆栈大小? 当我阅读了无数的文章和主题时,没有人知道如何进行操作,但是我暂时还没有想法.

Am I increasing the stack size of cc1plus.exe correctly? Does anyone has any clue how to proceed, as I read through countless articles and topics but I'm kind of out of ideas for the moment.

g ++似乎找到并接受了我的预编译头文件:

g++ seems to find and accept my precompiled header file:

Building file: ../src/AdvancedOgreFramework.cpp
Invoking: GCC C++ Compiler
g++ -DHAVE_W32API_H -DNO_GCC_PRAGMA -I"C:\DevelopmentTools\workspaces\workspace_cpp
\MyGame\inc" -I"C:\docs\ogre3d\CEGUI\CEGUI-0.7.6\cegui\include\falagard" -I"C:\docs 
\ogre3d\CEGUI\CEGUI-0.7.6\cegui\include\RendererModules\Ogre" -I"C:\docs\ogre3d\CEGUI
\CEGUI-0.7.6\cegui\include" -I"C:\docs\ogre3d\ogre1.8.0_mingw_sdk\OgreSDK_MinGW_v1-8-0
\include" -O0 -g3 -H -Wall -c -Winvalid-pch -MMD -MP -MF"src/AdvancedOgreFramework.d" 
-MT"src/AdvancedOgreFramework.d" -o "src/AdvancedOgreFramework.o" "../src 
/AdvancedOgreFramework.cpp"
! C:\DevelopmentTools\workspaces\workspace_cpp\MyGame\inc/Precompiled.h.gch

这是我作为预构建make运行以生成.gch的makefile:

And here is the makefile that I run as a pre-build make to generate my .gch:

C_FLAGS = -O0 -g3 -Wall -c -MMD -MP
INC_PATH = -IC:/docs/ogre3d/ogre1.8.0_mingw_sdk/OgreSDK_MinGW_v1-8-0/include -IC:/docs
/ogre3d/CEGUI/CEGUI-0.7.6-mingw/cegui/include -IC:/docs/ogre3d/CEGUI/CEGUI-0.7.6-
mingw/cegui/include/RendererModules/Ogre -IC:/docs/ogre3d/CEGUI/CEGUI-0.7.6-mingw/cegui
/include/falagard


all: Precompiled.h.gch

@echo 'Finished precompiling headers....'

Precompiled.h.gch: Precompiled.h    
    @echo 'Building target: $@'
g++.exe Precompiled.h $(INC_PATH) $(C_FLAGS)     

clean:
rm Precompiled.h.gch

.gch的大小超过169 MB,因为我正在尝试预编译大多数Ogre3D和CEGUI标头.

The .gch is over 169 MB in size as I am trying to precompile most of the Ogre3D and CEGUI headers.

谢谢你, 亚当.

推荐答案

GCC有关于您的问题的错误报告,请参见:

There is a bug report of GCC about your issue, see: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56926, it looks like big pch file(usually larger than 150M) can cause this issue.

2015-05-31.我最近在mingw或mingw-w64工具链的GCC源代码中为pch文件找到了硬限制值,即128M.我想建议有人建立一个最近的GCC,看看它是否解决了崩溃问题.请参阅我在mingw-w64论坛中的帖子: [Mingw-w64-public]设置一个更大的pch文件大小限制?是:谁能提供cc1plus.exe的调试版本?

2015-05-31. I recently found a hard limit value for the pch file in GCC source for mingw or mingw-w64 toolchain, which is 128M. I would like to suggest some one to build a recent GCC to see whether it solve this crash issue. See my post in mingw-w64 forum: [Mingw-w64-public] Set a larger pch file size limit? was : can anyone supply a debug version of cc1plus.exe?

2015-06-02.我可以通过扩大pch文件的硬限制值来完全解决此问题,请参见我的

2015-06-02. I can totally fix this issue by enlarge the hard limit value of the pch file, see my Comment 17 in gcc bugzilla.

这篇关于使用大型预编译头文件时cc1plus.exe崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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