在Eclipse IDE中需要进行哪些设置才能运行C / C ++ Clang格式插件?

问题描述 投票:2回答:1

我是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)

c++ eclipse eclipse-plugin clang clang-format
1个回答
0
投票

在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下。

© www.soinside.com 2019 - 2024. All rights reserved.