-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Environment
- OS and Version: Windows 10 22H2
- VS Code Version: 1.94.2 (user setup)
- C/C++ Extension Version: 1.22.9
Bug Summary and Steps to Reproduce
Since updating to 1.22.9, intellisense shows errors when including certain standard library headers, such as:
cannot open source file "stdlib.h" (dependency of "string") C/C++(1696)when including <string>cannot open source file "math.h" (dependency of "C:\Users\finno\.vscode\extensions\ms-vscode.cpptools-1.22.9-win32-x64\bin\entt\entt.hpp") C/C++(1696)when including a library that includes <cmath>
Often it will just say #include errors detected. Consider updating your compile_commands.json or includePath. Squiggles are disabled for this translation unit in an error at the top of the file.
Eventually I was able to trace each of these to a use of #include_next within the standard library code.
When downgrading back to 1.21.6, the errors go away.
I am building the project with Meson, and using the configuration provider from the Meson VSCode extension (which is automatically adding the includes for Meson dependencies).
When attempting to make a minimal reproduction, I found that the errors go away when I take away all dependencies, but come back as soon as I add one.
Looking at the logs from 'C/C++: Log Diagnostics' (specifically the ), there are exactly two differences between the broken version with a dependency and the working version with no dependencies. One is that "-IC:/msys64/ucrt64/bin/../include" is part of the compile command when there is a dependency, and not otherwise. The other is that, with a dependency, 'C:\msys64\ucrt64\include' is listed under 'Includes', wheras with no dependencies it is listed under 'SystemIncludes'.
When doing the same test on version 1.21.6, the difference in the compile command is still there, but 'C:\msys64\ucrt64\include' is always listed under 'SystemIncludes'.
Steps to reproduce
Download minimal reproduction project: minimal_reproduction.zip
Install version 1.22.9 of this extension, and the Meson extension.
Install Meson itself, and install GLEW such that it is visible to Meson as a package (instructions for doing this with msys2, like I did, can be found in the project readme).
Allow the Meson extension to auto-configure the project for you (there should be a popup on opening the folder).
Open src/main.cpp, and the line #include <string> should be throwing the 'include errors detected' and 'cannot open stdlib.h' errors.
Expected behavior
Should behave as it did on version 1.21.6
Configuration and Logs
c_cpp_properties.json:
{ "configurations": [ { "name": "Win32", "includePath": [ "${workspaceFolder}/**" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "windowsSdkVersion": "10.0.22621.0", "configurationProvider": "mesonbuild.mesonbuild" } ], "version": 4 }
C/C++: Log Diagnostics:
-------- Diagnostics - 10/15/2024, 8:42:51 PM
Version: 1.22.9
Current Configuration:
{
"name": "Win32",
"includePath": [
"d:/Documents/University/Year 3/CMP316/Untitled Tabletop Engine/"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.22621.0",
"configurationProvider": "mesonbuild.mesonbuild",
"compilerPathIsExplicit": false,
"cStandardIsExplicit": false,
"cppStandardIsExplicit": false,
"intelliSenseModeIsExplicit": false,
"configurationProviderInCppPropertiesJson": "mesonbuild.mesonbuild",
"compileCommands": "d:\Documents\University\Year 3\CMP316\Untitled Tabletop Engine/builddir/compile_commands.json",
"mergeConfigurations": false,
"browse": {
"path": [
"d:/Documents/University/Year 3/CMP316/Untitled Tabletop Engine/",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
Modified Settings:
{
"C_Cpp.suggestSnippets": false,
"C_Cpp.default.compileCommands": "${workspaceFolder}/builddir/compile_commands.json",
"C_Cpp.default.configurationProvider": "mesonbuild.mesonbuild"
}
Additional Tracked Settings:
{
"editorTabSize": 4,
"editorInsertSpaces": true,
"editorAutoClosingBrackets": "languageDefined",
"filesEncoding": "utf8",
"filesAssociations": {},
"filesExclude": {
"/.git": true,
"/.svn": true,
"/.hg": true,
"/CVS": true,
"/.DS_Store": true,
"/Thumbs.db": true
},
"filesAutoSaveAfterDelay": false,
"editorInlayHintsEnabled": true,
"editorParameterHintsEnabled": true,
"searchExclude": {
"/node_modules": true,
"/bower_components": true,
"**/*.code-search": true
},
"workbenchSettingsEditor": "ui"
}
Custom browse configuration:
{
"browsePath": [
"C:/msys64/ucrt64/bin/../include"
],
"compilerPath": "c++",
"compilerArgs": []
}
cpptools version (native): 1.22.8.0
Current database path: C:\USERS\FINNO\APPDATA\LOCAL\MICROSOFT\VSCODE-CPPTOOLS\EB23A48A33504FB587F647B61105A6C8.BROWSE.VC.DB
Translation Unit Mappings:
[ D:\Documents\University\Year 3\CMP316\Untitled Tabletop Engine\src\main.cpp - source TU]:
Translation Unit Configurations:
[ D:\Documents\University\Year 3\CMP316\Untitled Tabletop Engine\src\main.cpp ]
Process ID: 10036
Memory Usage: 100 MB
Compiler Path: C:\msys64\ucrt64\bin\c++.exe
Includes:
D:\Documents\University\Year 3\CMP316\Untitled Tabletop Engine\builddir\client.exe.p
D:\Documents\University\Year 3\CMP316\Untitled Tabletop Engine\builddir
D:\Documents\University\Year 3\CMP316\Untitled Tabletop Engine
C:\msys64\ucrt64\include
System Includes:
C:\msys64\ucrt64\include\c++\14.1.0
C:\msys64\ucrt64\include\c++\14.1.0\x86_64-w64-mingw32
C:\msys64\ucrt64\include\c++\14.1.0\backward
C:\msys64\ucrt64\lib\gcc\x86_64-w64-mingw32\14.1.0\include
C:\msys64\ucrt64\lib\gcc\x86_64-w64-mingw32\14.1.0\include-fixed
Defines:
_GLIBCXX_ASSERTIONS=1
_FILE_OFFSET_BITS=64
Standard Version: c++17
IntelliSense Mode: windows-gcc-x64
Other Flags:
--g++
--gnu_version=140100
compile_commands.json entry:
directory: D:\Documents\University\Year 3\CMP316\Untitled Tabletop Engine\builddir
file: ../src/main.cpp
command: "c++" "-Iclient.exe.p" "-I." "-I.." "-IC:/msys64/ucrt64/bin/../include" "-fdiagnostics-color=always" "-D_GLIBCXX_ASSERTIONS=1" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-O0" "-g" -MD -MQ client.exe.p/src_main.cpp.obj -MF "client.exe.p\src_main.cpp.obj.d" -o client.exe.p/src_main.cpp.obj "-c" ../src/main.cpp
output: client.exe.p/src_main.cpp.obj
Total Memory Usage: 100 MB
Browse Paths from compile_commands.json, from workspace folder: D:\Documents\University\Year 3\CMP316\Untitled Tabletop Engine
C:\msys64\ucrt64\include
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 4305
Other Extensions
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status