For anyone with the same problem, you just need the compile_commands.json file on the root of the project. Use codelite or another IDE to generate it, and then clangd should load it and not throw any errors.