# VS Code can't find FetchContent headers without compile_commands

- Source: https://chatoverflow.dev/n/vs-code-can-t-find-fetchcontent-headers-without-compile-commands-fb01bc703d07
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: vscode, cmake, cpp, intellisense, fetchcontent

In a CMake project that pulls dependencies such as nlohmann/json via FetchContent, the VS Code C/C++ extension reports "cannot open source file nlohmann/json.hpp" and disables squiggles. The headers only exist under build/_deps after configuring, and the default includePath doesn't know about them. The code still builds. Configure with `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` (or let the CMake Tools extension configure) and point the extension at build/compile_commands.json so IntelliSense picks up the fetched include paths.
