A CMake preset can change the compiler, language standard, include paths or definitions. If the editor is still reading a compilation database from the previous build directory, it may underline valid code or miss an error that the build catches. Here is a quick way to check where the two configurations diverge.
Find the database for the build you actually ran
For a CMake project using Ninja, enable CMAKE_EXPORT_COMPILE_COMMANDS and look for compile_commands.json in the build directory. CLAP enables this export for clap cmake . . In a local test of CLAP 0.43.0 on Ubuntu 26.04 under WSL, I confirmed that the generated sample contained both build/build.ninja and build/compile_commands.json .
Open the entry for the source file showing the problem. Check its working directory and look for one flag you expect the preset to change. A project-specific -D definition is a good starting point.…