vscode-cpptools
vscode-cpptools copied to clipboard
reported errors in integrating with mingw64
Environment
- OS and Version: Windows_NT x64 10.0.19045
- VS Code Version: Version: 1.94.2 (user setup) Commit: https://github.com/microsoft/vscode/commit/384ff7382de624fb94dbaf6da11977bba1ecd427 Date: 2024-10-09T16:08:44.566Z Electron: 30.5.1 ElectronBuildId: 10262041 Chromium: 124.0.6367.243 Node.js: 20.16.0 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.19045
- C/C++ Extension Version: v1.21.6
- If using SSH remote, specify OS of remote machine:
Bug Summary and Steps to Reproduce
Bug Summary: Errors reported as follows:
[10/13/2024, 3:59:28 PM] Unable to resolve configuration with compilerPath "C:/msys64/mingw64/bin/g++.exe". Using "C:\msys64\mingw64\bin\gcc.exe" instead.
Also, problems regarding the cpp file:
cannot open source file "stdlib.h" (dependency of "algorithm"). Please run the 'Select IntelliSense Configuration...' command to locate your system headers.
map is not a template
namespace "std" has no member "vector"
type name is not allowed
identifier "vec" is undefined
namespace "std" has no member "cout"
identifier "cout" is undefined
argument list for variable template "endl" is missing
identifier "vector" is undefined
type name is not allowed
Steps to Reproduce:
-
install mingw64 on my Win10 Laptop, whose g++ version is C:\Users\li_family>g++ --version g++ (Rev3, Built by MSYS2 project) 14.1.0
-
In VS Code open a local folder containing my cpp file, say stl.cpp. Setup the VS Code as follows:
settings.json
{
"C_Cpp.errorSquiggles": "enabled",
"C_Cpp.default.compilerPath": "C:/msys64/mingw64/bin/g++.exe"
}
c_cpp_properties.json
{
"configurations": [
{
"name": "W32",
"includePath": [
"${workspaceFolder}/**",
"C:/msys64/mingw64/include",
"C:/msys64/mingw64/include/c++/14.1.0",
"C:/msys64/mingw64/include/c++/14.1.0/x86_64-w64-mingw32"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:/msys64/mingw64/bin/g++.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}
Configuration and Logs
c_cpp_properties.json
{
"configurations": [
{
"name": "W32",
"includePath": [
"${workspaceFolder}/**",
"C:/msys64/mingw64/include",
"C:/msys64/mingw64/include/c++/14.1.0",
"C:/msys64/mingw64/include/c++/14.1.0/x86_64-w64-mingw32"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:/msys64/mingw64/bin/g++.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}
-------- Diagnostics - 10/14/2024, 10:55:08 AM
Version: 1.21.6
Current Configuration:
{
"name": "mingw64",
"includePath": [
"c:/technical learning/C_C++/**",
"C:/msys64/mingw64/include",
"C:/msys64/mingw64/include/c++/14.1.0",
"C:/msys64/mingw64/include/c++/14.1.0/x86_64-w64-mingw32"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:/msys64/mingw64/bin/g++.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64",
"compilerPathIsExplicit": true,
"cStandardIsExplicit": true,
"cppStandardIsExplicit": true,
"intelliSenseModeIsExplicit": true,
"compilerPathInCppPropertiesJson": "C:/msys64/mingw64/bin/g++.exe",
"mergeConfigurations": false,
"browse": {
"path": [
"c:/technical learning/C_C++/**",
"C:/msys64/mingw64/include",
"C:/msys64/mingw64/include/c++/14.1.0",
"C:/msys64/mingw64/include/c++/14.1.0/x86_64-w64-mingw32",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
cpptools version (native): 1.21.6.0
Translation Unit Mappings:
[ C:\technical learning\C_C++\STL.cpp - source TU]:
Translation Unit Configurations:
[ C:\technical learning\C_C++\STL.cpp ]:
Process ID: 4416
Memory Usage: 97 MB
Includes:
C:\msys64\mingw64\include
C:\msys64\mingw64\include\c++\14.1.0
C:\msys64\mingw64\include\c++\14.1.0\x86_64-w64-mingw32
Defines:
_DEBUG
UNICODE
_UNICODE
Standard Version: ms_c++17
IntelliSense Mode: windows-msvc-x64
Total Memory Usage: 97 MB
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 4186
------- Potential include path issues --------
Some headers exist in multiple locations. If IntelliSense is behaving incorrectly,
try adding one of the alternate paths to the "includePath" in your configuration in
c_cpp_properties.json to override the automatic path discovery for that header.
Using: C:/msys64/mingw64/include/c++/14.1.0/map
Alternative: "C:/technical learning/C_C++"
Using: C:/msys64/mingw64/include/c++/14.1.0/vector
Alternative: "C:/technical learning/C_C++/vector.dSYM/Contents/Resources/DWARF"
Other Extensions
No response
Additional context
No response