首选,需要安装 cmake-tool 插件。

其次,需要在 c_cpp_properties.json 中加入以下配置:

{
"configurations": [
{
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}

  1. VSCode C/C++ Intellisense not working with CMake project

发表回复

您的电子邮箱地址不会被公开。