clangd 的头文件搜索目录有哪些?如何设置?

Windows 10 系统下clangd 的头文件搜索目录有哪些,如果需要依赖开源c++库的话,如何将其添加到Clangd的头文件搜索路径?

我现在的环境是Emacs 26 + LSP-mode + clangd,在安装visual studio 2017后 clangd默认能够搜索到visual studio 目录下的头文件,比如iostream等,但是当依赖其他库的话,如何设置才能使其搜索到呢?

目前我只查到 clangd有个参数是“-compile-commands-dir” : " Specify a path to look for compile_commands.json. If path is invalid, clangd will look in the current directory and parent paths of each source file.”

但是对“compile_commands.json”如何设置确实一窍不通,虽然也查到一些信息,但是还是不容易理解。

你可以从ccls的wiki学习compile_commands.json

Project Setup · MaskRay/ccls Wiki · GitHub

1 个赞