CLANG格式在缺少libtinfo.so.5库中不起作用

clang-format not working in missing libtinfo.so.5 library

本文关键字:不起作用 so libtinfo 格式 CLANG      更新时间:2023-10-16

我正在尝试在 Ubuntu 20 中设置 vim 以进行C++编辑。我想使用 clang 格式来格式化我的文件。我的 vimrc 如下所示:

map <C-K> :py3f /usr/local/clang-10.0.0/share/clang/clang-format.py<cr>
imap <C-K> <c-o>:py3f /usr/local/clang-10.0.0/share/clang/clang-format.py<cr>

当我通过在代码块上按 C-k 在 vim 中运行它时,我收到此错误:

b'clang-format: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directoryn'
No output from clang-format (crashed?).
Please report to bugs.llvm.org.

以前有人遇到过这种情况吗?我该如何解决此问题?

整理出来了。看起来 Ubuntu 20 有 libtinfo.so.6。我使用以下方法安装了libtinfo.so.5软件包:

sudo apt update && sudo apt install -y libtinfo5

注意 - 我看到一些关于在libtinfo.so.6文件上做别名"ln -s"的帖子。这对我不起作用。