我目前正在尝试设置一个 .clangd 文件以用于我的 lsp ...
如何添加多个编译标志? 我的文件是自动生成的,如下所示:
CompileFlags:
Add:
- -IC:\Users\adria\Desktop\Nimble_New\include
- -IC:\Users\adria\Desktop\Nimble_New\include\lua
- -IC:\Users\adria\Desktop\Nimble_New\include\raylib
- -IC:\Users\adria\Desktop\Nimble_New\include\rlimgui
- -IC:\Users\adria\Desktop\Nimble_New\include\rlimgui\extras
- -IC:\Users\adria\Desktop\Nimble_New\src
- -IC:\Users\adria\Desktop\Nimble_New\src\asseteditor
- -IC:\Users\adria\Desktop\Nimble_New\src\textureeditor
- -IC:\Users\adria\Desktop\Nimble_New\src\ui
- -IC:\Users\adria\Desktop\Nimble_New\src\utils
我也试过这样:
CompileFlags:
Add: [-IC:\Users\adria\Desktop\Nimble_New\include,-IC:\Users\adria\Desktop\Nimble_New\include\lua,-IC:\Users\adria\Desktop\Nimble_New\include\raylib,-IC:\Users\adria\Desktop\Nimble_New\include\rlimgui,-IC:\Users\adria\Desktop\Nimble_New\include\rlimgui\extras,-IC:\Users\adria\Desktop\Nimble_New\src,-IC:\Users\adria\Desktop\Nimble_New\src\asseteditor,-IC:\Users\adria\Desktop\Nimble_New\src\textureeditor,-IC:\Users\adria\Desktop\Nimble_New\src\ui,-IC:\Users\adria\Desktop\Nimble_New\src\utils]
如果我这样做:
CompileFlags:
Add: -IC:\Users\adria\Desktop\Nimble_New\include\raylib
或者:
CompileFlags:
Add:
- -IC:\Users\adria\Desktop\Nimble_New\include\raylib
它对于一个包含路径工作得很好,但一旦我添加另一个包含路径,它就不再加载。
还有其他解决方案吗?
Add:
相对于 CompileFlags:
缩进非常重要。
前两个示例中的任何一个都应该适用于该更改,例如:
CompileFlags:
Add:
- -IC:\Users\adria\Desktop\Nimble_New\include
- -IC:\Users\adria\Desktop\Nimble_New\include\lua
- -IC:\Users\adria\Desktop\Nimble_New\include\raylib
- -IC:\Users\adria\Desktop\Nimble_New\include\rlimgui
- -IC:\Users\adria\Desktop\Nimble_New\include\rlimgui\extras
- -IC:\Users\adria\Desktop\Nimble_New\src
- -IC:\Users\adria\Desktop\Nimble_New\src\asseteditor
- -IC:\Users\adria\Desktop\Nimble_New\src\textureeditor
- -IC:\Users\adria\Desktop\Nimble_New\src\ui
- -IC:\Users\adria\Desktop\Nimble_New\src\utils
(如果仍然不行,请发布clangd日志以进一步诊断。)