windows - git for windows中的cygheap不匹配错误
问题描述
尝试在 Git Bash 中运行 shell 脚本。这个特定的脚本需要 Rcpp 和 RcppArmadillo 包。(创建一个用 C++ 实现的 R 包)因为我在 Windows 系统上,所以我必须安装 Rtools40。执行sh
命令后,我收到错误:
fatal error - cygheap base mismatch detected - 0x180316408/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.
我试过的:
- 按照错误消息中的说明进行操作。但是,对 cygwin1.dll 的搜索结果为空。此外,我从未在我的机器上安装过 Cygwin。
- 将 R、Rtools40 和 Git for Windows 更新到最新版本。这是非常需要的(显然 Windows 不会自动更新这些程序sigh)但它没有解决错误消息。
- 如本文和本文所述,在 Windows 安全设置中关闭 ASLR 保护。
- 从我的驱动器中删除重复的 msys-2.0.dll 文件。这最终奏效了。我将详细发布解决方案作为这个问题的答案。
希望这对像我一样一直在筛选许多没有完全回答这个问题的帖子的人有所帮助。
解决方案
所以这就是我解决这个问题的方法。据我了解,Git Bash 中的错误消息已经过时且具有欺骗性。它引用了 Cygwin,但 Git Bash 实际上使用的是 MSYS2,而不是 Cygwin。因此,我不需要搜索 cygwin1.dll,而是需要在我的驱动器中搜索 msys-2.0.dll。该文件存在于两个位置:Git\usr\bin 和 rtools40\SOMETHING(我不记得确切的路径,但它与 Rtools40 相关联)。根据错误消息中的说明,我删除了较旧的版本,它恰好是与 Rtools40 相关联的版本。我的驱动器上只剩下一个版本的 msys-2.0.dll,然后该sh
命令在 Git Bash 中执行,没有任何问题。
我仍然困惑的是:为什么 Git Bash 中的错误消息没有更新?Cygwin 和 MSYS2 有什么区别?我知道它们都在 Windows 上强加了 UNIX 环境,但是其中一个有优点还是缺点?从长远来看,如果我想通过命令行执行脚本,Git Bash 是可持续的,还是应该只在我的机器上创建一个 Linux 分区?
推荐阅读
- python - 如何在python中编辑矩阵中的值?
- ascii - 为什么 '[' 和 ']' ASCII 码不相互跟随?
- python - OSError: [WinError 126] 未找到模块
- javascript - Github 网页外部 css 无法正常工作,但 js 工作正常
- docker - Nuxt.js SSR w/ Nest API 在 Docker 容器中部署到 AWS
- android - 如何在flutter中使用fxpoi包读取CSV文件
- python - 使用 keras 将图像划分为子部分
- python - Python同时监听和分析数据
- python-3.x - Pandas 对条形图进行分组和重采样:
- javascript - 适用于 PDF-417 格式的 Javascript 条码/OCR 阅读器