Can't clangd in cmake (already enabled export compile command) work out of the box?

on April 19, 2022 SOLVED

In my emacs, I use lsp-emacs + clangd, there are so many clangd error outputs but it can compile success, there’s also happened in other projects. And when I use clion with clangd these errors are just gone and the syntax check outputs are the same as compiler compilation output.

These are my operations when I get starting with a project: cmake -B build -DCMAKE_EXPORT_COMPILE_COMMAND=YES -DCMAKE_BUILD_TYPE=Debug && ln -s build/compile_command.json ..

Are there any operations and configurations I missed?

here’s my collected info following the lsp troubleshooting guide

(new user only can send one media so I combined it with a screenshot)

And I wonder if there’s some better tracing workflow for solving lsp-related issues?

1 Like