第一步:要安装 EasyClangComplete,首先你需要有 Package Control。然后按关注
CTRL+Shift+P for Windows
CMD+Shift+P for MacOS
现在搜索包控制:安装包并按回车键。然后搜索 EasyClangComplete 并安装它。
Step2:需要安装Clang
Ubuntu : sudo apt-get install clang
MacOS : By default installed. You are all set!
Windows : install the latest release from clang website.
检查是否安装成功
clang --version
Step3:配置编译器标志并包含文件夹。
对于这一步,您只需要在项目根文件夹中创建 2 个空文件。
CMakeLists.txt
compile_commands.json
现在,重新启动 sublime 文本编辑器和自动完成功能将成功运行。
如果这不起作用,您需要再执行 1 步。
进入包设置 > EasyClangComplete > 设置。现在在文件“EasyClangComplete.sublime-settings”中添加以下代码
{
"common_flags" : [
// some example includes
"-I/usr/include",
"-I$project_path/src",
// this is needed to include the correct headers for clang
"-I/usr/lib/clang/$clang_version/include",
// For simple projects, you can add a folder where your current file is
"-I$file_path",
],
}