我应该如何修复cygwin和git致命错误的windows

9njqaruj  于 2023-03-11  发布在  Git
关注(0)|答案(2)|浏览(235)

我已经为我的windows安装了git和cygwin,它工作得很好。但是最近几天我遇到了一些致命的错误。

0 [main] cut (26740) C:\Users\bin\cut.exe: *** fatal error - cygheap base mismatch detected - 0x180347408/0x180346408.
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.

我试着删除cygwin1.dll,并尝试,但我仍然得到同样的错误。我们如何才能解决这个问题。任何解决方案将是有帮助的。

mfpqipee

mfpqipee1#

错误消息具有误导性
Git for Windows使用cygwin1.dll,它使用来自Mingw64项目的修改版本msys-2.0.dll

$ objdump -x cut.exe |grep "DLL Name:"
        DLL Name: msys-intl-8.dll
        DLL Name: msys-2.0.dll
        DLL Name: KERNEL32.dll

但他们忘记修改错误信息

$ grep cygwin1.dll msys-2.0.dll
grep: msys-2.0.dll: binary file matches

可能的原因是你的PATH中有两个使用Mingw64基础设施的程序,我建议你以这样的方式清理PATH,使git for Windows不会与它们冲突。

w8f9ii69

w8f9ii692#

最佳实践是单独安装Git For Windows(不安装Cygwin),然后将添加到您的%PATH%

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set "GH=%ProgramFiles%\Git"
set "PATH=%GH%\bin;%GH%\cmd;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%"

这将包括200多个Linux命令(来自常规CMD),包括C:\Program Files\Git\usr\bin\cut.exe
这样就可以避免任何cygwin1.dll错误。

相关问题