
Title:
📌 #include errors in C++ despite correct settings in VS Code (MSYS2 GCC)
Description:
I am experiencing persistent #include errors in VS Code with the C/C++ extension, even though my code compiles fine. IntelliSense is failing to detect standard headers, and squiggles appear under #include and other system headers.
VS Code Info:
VS Code Version: 1.97.2 (User Setup)
C/C++ Extension Version: 1.23.6
OS: Windows 11 Home Single Language (Version 24H2)
Compiler: MSYS2 GCC (C:\msys64\ucrt64\bin\gcc.exe -v output below)
Error Message:
#include errors detected. Please update your includePath.
Steps to Reproduce:
Open a C++ file in VS Code.
Add #include (or any standard library).
The editor shows an #include error, even though the file compiles fine.
What I Have Tried (None Worked):
✅ Installed/Reinstalled the C/C++ Extension
✅ Verified compilerPath in c_cpp_properties.json
✅ Manually added includePath for MSYS2 GCC
✅ Used "C_Cpp.default.includePath" in VS Code Settings
✅ Reset IntelliSense Cache (C/C++: Reset IntelliSense Database)
✅ Ran Extension Bisect (No conflicting extensions found)
✅ Fully reinstalled VS Code and deleted Code folder in AppData
✅ Issue persists with older versions of the C/C++ extension
Expected Behavior:
VS Code should correctly detect #include paths for IntelliSense without showing errors.
Configuration and Logs
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:\\msys64\\ucrt64\\bin\\gcc.exe",
"intelliSenseMode": "${default}"
}
],
"version": 4
}
Other Extensions
i have installed only two extensions
- C/C++ Extension Pack(Microsoft)
- Coderunner
Additional context
Running gcc.exe -v confirms that the include paths exist.
Downgrading to older versions of the C/C++ extension (e.g., 1.23.4, 1.23.3) does not resolve the issue.
Title:
📌 #include errors in C++ despite correct settings in VS Code (MSYS2 GCC)
Description:
I am experiencing persistent #include errors in VS Code with the C/C++ extension, even though my code compiles fine. IntelliSense is failing to detect standard headers, and squiggles appear under #include and other system headers.
VS Code Info:
VS Code Version: 1.97.2 (User Setup)
C/C++ Extension Version: 1.23.6
OS: Windows 11 Home Single Language (Version 24H2)
Compiler: MSYS2 GCC (C:\msys64\ucrt64\bin\gcc.exe -v output below)
Error Message:
#include errors detected. Please update your includePath.
Steps to Reproduce:
Open a C++ file in VS Code.
Add #include (or any standard library).
The editor shows an #include error, even though the file compiles fine.
What I Have Tried (None Worked):
✅ Installed/Reinstalled the C/C++ Extension
✅ Verified compilerPath in c_cpp_properties.json
✅ Manually added includePath for MSYS2 GCC
✅ Used "C_Cpp.default.includePath" in VS Code Settings
✅ Reset IntelliSense Cache (C/C++: Reset IntelliSense Database)
✅ Ran Extension Bisect (No conflicting extensions found)
✅ Fully reinstalled VS Code and deleted Code folder in AppData
✅ Issue persists with older versions of the C/C++ extension
Expected Behavior:
VS Code should correctly detect #include paths for IntelliSense without showing errors.
Configuration and Logs
{ "configurations": [ { "name": "Win32", "includePath": [ "${workspaceFolder}/**" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "compilerPath": "C:\\msys64\\ucrt64\\bin\\gcc.exe", "intelliSenseMode": "${default}" } ], "version": 4 }Other Extensions
i have installed only two extensions
Additional context
Running gcc.exe -v confirms that the include paths exist.
Downgrading to older versions of the C/C++ extension (e.g., 1.23.4, 1.23.3) does not resolve the issue.