我是Eclipse的新手。我想将eclipse c ++项目的编码格式更改为Clang格式。我在其他论坛中签到,发现Eclipse插件“ CppStyle 1.5.0.0”。我已经安装了它,并且还如下所述更新了Eclipse中的设置。参考:https://github.com/wangzw/CppStyle
Properties-> C / C ++ General-> Formatter-> Code Formatter-> CppStyle(Clang格式)
此后,我选择代码并按Ctrl + Shift + f更改格式。
但是它给出错误代码“ clang-format()不存在。”
我检查了很多地方,但尚未找到解决方案。我的日食设置是否有问题或其他原因?
系统信息:
Windows 10Eclipse IDE版本:Oxygen.3a发行版(4.7.3a)
在Windows上,您似乎必须安装完整的LLVM二进制文件集才能获得clang-format.exe
。从https://releases.llvm.org/download.html获取并安装。如果使用默认路径,将在C:\Program Files\LLVM\bin\clang-format.exe
中找到它。转到Window-> Preferences-> C / C ++-> CppStyle并将此完整路径放在Clang-format path下。