MSYS2 gcc fatal error in cc1.exe: cygheap base mismatch detected

删除回忆录丶 提交于 2020-08-19 10:47:51

问题


This particular error has come up in multiple other contexts on Stack Overflow, typically regarding Cygwin or git (and involving other executables). I have not seen this in the context of MSYS2 and I am not sure how to address it. This is happening on a brand new install of MSYS2 using pacman -S gcc which installs gcc version 9.3.0. When I go to run my makefile, this is the error that comes up:

0 [main] cc1 (2724) C:\msys64_close\usr\lib\gcc\x86_64-pc-msys\9.3.0\cc1.exe: 
*** fatal error - cygheap base mismatch detected - 0x180346408/0x180317408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.

The file cygwin1.dll does not exist anywhere within the msys64 folder. The MSYS2 home page states:

Cygwin provides a runtime library called cygwin1.dll that provides the POSIX compatibility layer where necessary. The MSYS2 variant of this library is called msys-2.0.dll...

I am not sure if the problem resides with gcc or MSYS2. I tried to install older versions of gcc from http://repo.msys2.org/ but every time I try to use a lower version than 9.3.0 I get warnings that gcc cannot be "upgraded" due to unresolved dependencies.

Any assistance would be greatly appreciated.


回答1:


The problem was that the msys-2.0.dll that is required in the same directory as the makefile for the program was not matching the same file in:

msys64/usr/bin

I essentially had an older version of this file, and since they did not match up the above error was produced. If you are met with this problem, you need to copy and paste the newer version from above into the directory where you are compiling your software (for me it was the directory with the makefile). Once that was done the software compiled without error.



来源:https://stackoverflow.com/questions/62903833/msys2-gcc-fatal-error-in-cc1-exe-cygheap-base-mismatch-detected

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!