ubuntu19.10下vscode无法格式化C++代码并且显示“Formatting failed See the output window for details“的解决办法

vscode安装了C++插件之后,按CTRL+I无法排版代码,显示错误

Formatting failed. See the output window for details

使用CTRL+J打开终端,并将终端窗口的Task下拉列表切换成C/C++
在这里插入图片描述
查看output,显示

error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

在终端输入ls /lib/x86_64-linux-gnu/libtinfo.so.*,显示:
/lib/x86_64-linux-gnu/libtinfo.so.6 /lib/x86_64-linux-gnu/libtinfo.so.6.1

原来是ubuntu19.10没有libtinfo.so.5,可以安装下面这个包

sudo apt-get install libncurses5

猜你喜欢

转载自blog.csdn.net/X_And_Y/article/details/103245963