Issue
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.
Solution
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.
Answered By - Leigh K