通过Cygwin安装的Clang-format无法运行

4

当我在Cygwin64终端中尝试运行clang-format时,会得到以下输出:

$ clang-format
: CommandLine Error: Option 'disable-symbolication' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

我也无法在Git Bash中运行它,会得到以下输出:
$ clang-format
      1 [main] clang-format (2208) C:\cygwin64\bin\clang-format.exe: *** fatal error - cygheap base mismatch detected - 0x180301410/0x1802FD410.
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.

我的 C:\cygwin64\bin 目录下只有一个 cygwin1.dll 文件,重启也无效。

clang --version 的输出为:

$ clang --version
clang version 5.0.1 (tags/RELEASE_501/final)
Target: x86_64-unknown-windows-cygnus
Thread model: posix
InstalledDir: /usr/bin

同样的问题出现在这里。看起来是一个软件包构建错误。你应该在Cygwin邮件列表上报告这个问题。 - matzeri
已为您完成 http://www.cygwin.com/ml/cygwin/2018-05/msg00237.html - matzeri
@matzeri 谢谢!!! - Erik Johnson
刚在昨天更新了,但错误仍然存在(或者出现了相同的错误)。回退到clang 4... 嗯...显示“解决方案2/2(默认)-不要请求卸载libclang5.0-5.0.1-2”...哦天啊。 - Orwellophile
1个回答

1
这不算是一个很好的答案,但这就是我最终做的事情。而且这有点棘手,所以我打算在这里记录一下。
请注意,我实际上降级了doxygen,因为最新版本依赖于clang-format-5。
Uninstall clang 5.0.1-2
Uninstall doxygen 1.8.14-2 (automatically added)
Uninstall libclang5.0 5.0.1-2
Uninstall vim-clang-format 4.0.1-1
Install doxygen 1.8.13-3

然后(按返回键)
Uninstall clang 5.0.1-2 (automatically added)
Uninstall doxygen 1.8.13-3 (automatically added)
Install clang 4.0.1-1
Install doxygen 1.8.13-3

经过所有这些步骤,尽管没有clang-format的入口,但我电脑上已安装并可用clang-format-4.0.1。


谢谢!我将其标记为答案,因为它有效,但Cygwin/Clang团队仍未解决此问题。 - Erik Johnson
我也遇到了这个问题,但是我没有安装doxygen。我是先安装doxygen然后再降级来解决这个问题吗? - Fei

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接