IntelliSense & Code Completion Fails Unless Compiler Paths are Added to PATH Environmental Variable
@Colengms is already working on this.
Since Sep 15, 2026.
Assessment
This issue has not been assessed yet.
Description
Environment
- OS and Version: Windows 11
- VS Code Version: 1.125.1
- C/C++ Extension Version: 1.33.4
- If using SSH remote, specify OS of remote machine:
Bug Summary and Steps to Reproduce
The ms-vscode.cpptools extension fails to evaluate the PATH variables provided by e.g. a CMake preset, terminal.integrated.env.windows or cmake.environment (or any other cmake.*Environment) variables, nor is there an option to explicitly specify a PATH environmental variable to be used by the extension, like C_Cpp.path.
This results in the build environment not being detected correctly. IntelliSense and code completion does not work.
Building via the ms-vscode.cmake-tools extension works perfectly fine, since it is evaluating the environment specified in a CMakePresets.json (s. excerpt):
{
"configurePresets": [
{
"name": "<PRESET_NAME>",
"displayName": "'<PRESET_NAME>' config",
"description": "'<PRESET_NAME>' configure using 'Unix Makefiles' generator",
"generator": "Unix Makefiles",
"environment": {
"PATH": "<PATH_TO_COMPILER_ROOT>/sysroots/x86_64-petalinux-mingw32/usr/bin:$penv{PATH}"
}
}
],
}
I do not want to alter the PATH environmental variable of the system, in order not to create conflicts with other projects I am working on. This means I have to manually specify the path every time in a CMD.exe,
C:\PATH\TO\PROJECT>set PATH=<PATH_TO_COMPILER_ROOT>\sysroots\x86_64-petalinux-mingw32\usr\bin;%PATH%
C:\PATH\TO\PROJECT>code .
or create a batch file, to start code with the correct environment.
Am I missing a way how to set the environment, particularly for a project - not system wide?
Could you please add a feature to set the PATH used by ms-vscode.cpptools ? Ideally the one from the CMake preset is automatically used.
Configuration and Logs
[7/10/2026, 12:12:00 PM] Unable to resolve configuration with compilerPath "<PATH_TO_COMPILER_ROOT>/sysroots/x86_64-petalinux-mingw32/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-g++.exe". Using "cl.exe" instead.
Other Extensions
No response
Additional context
No response
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 60
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-cpptools
-
more info needed
microsoft/vscode-cpptools#14793 · 1 comment · 1 assignee ·
-
more info needed
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/vscode-cpptools#14787 · 1 comment · 1 assignee ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries Openbug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 1 comment · 1 assignee ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · 1 comment · 1 assignee ·
-
Feature Request Language Service parser
Difficulty 4/5 3-5 days Newbie friendliness 64/100
microsoft/vscode-cpptools#14769 · 1 comment ·
All issues in microsoft/vscode-cpptools
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug v2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelcontextprotocol/inspector#2458 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
carbon-design-system/ibm-products#9907 ·