marsevilspirit's blog

Neovim CMake Cannot Find Header Files

Add to CMakeList.txt:

1
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

This will generate a compile_commands.json file, which records detailed information during compilation. nvim will use this file to find header files. Place compile_commands.json in the project root directory.

Nov 2024