c_cpp_properties.json
my code
error tip

I just tried out mingw-w64 and was able to get std types to resolve by adding "__cdecl=" to the "defines" array in c_cpp_properties.json. Can you give that a try and let me know if that resolves your issue?
Thank you.
After add __cdecl=__attribute__((__cdecl__)),the problem was solved.
https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/MinGW.md might help with other MinGW issues too, e.g. according to that __GNUC__=5 should be used with MinGW 5.3.
Yeah, I updated that page last night after looking at this issue, but I forgot to post back here.
could someone please expound on the solution
@EdwinWalela The symptom has many possible causes. Can you file a new bug with repro details? We need to know what OS and compiler you're using.
c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}",
"C:/MinGW/include/*",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++/mingw32"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"__cdecl=__attribute__((__cdecl__))"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"${workspaceFolder}",
"C:/MinGW/include/*",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++/mingw32"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 3
}
Same problem: namespace "std" has no member "cout"
@g00ntar, if you have the latest version of the extension installed, you should set the "compilerPath" property and remove the system includes/defines from your includePath and defines. I'm in the process of updating the documentation for today's release which will also allow you to remove the system include paths from browse.path
Also, change intelliSenseMode to "clang-x64".
I've followed instruction described in https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/Windows%20Subsystem%20for%20Linux.md, however, the intellisense tool generate: _namespace "std" has no member "cout"_. This issue also is presented with other members in headers I use in my project, e.g., _namespace "omnetpp" has no member "simsignal_t"_
c_cpp_properties.json
{
"configurations": [
{
"name": "WSL",
"intelliSenseMode": "clang-x64",
"compilerPath": "/usr/bin/gcc",
"includePath": [
"${workspaceFolder}",
"/mnt/c/Users/Geo/omnetpp-5.2/include",
"/mnt/c/Users/Geo/omnetpp-5.2/include/omnetpp",
"/mnt/c/Users/Geo/omnetpp-5.2/include/omnetpp/platdep",
"/mnt/c/Users/Geo/omnetpp-5.2/include/platdep",
"/mnt/c/Users/Geo/omnetpp-5.2/src/cmdenv",
"/mnt/c/Users/Geo/omnetpp-5.2/src/common",
"/mnt/c/Users/Geo/omnetpp-5.2/src/envir",
"/mnt/c/Users/Geo/omnetpp-5.2/src/eventlog",
"/mnt/c/Users/Geo/omnetpp-5.2/src/layout",
"/mnt/c/Users/Geo/omnetpp-5.2/src/nedxml",
"/mnt/c/Users/Geo/omnetpp-5.2/src/qtenv",
"/mnt/c/Users/Geo/omnetpp-5.2/src/qtenv/osg",
"/mnt/c/Users/Geo/omnetpp-5.2/src/scave",
"/mnt/c/Users/Geo/omnetpp-5.2/src/sim",
"/mnt/c/Users/Geo/omnetpp-5.2/src/sim/netbuilder",
"/mnt/c/Users/Geo/omnetpp-5.2/src/sim/parsim",
"/mnt/c/Users/Geo/omnetpp-5.2/src/tkenv",
"/mnt/c/Users/Geo/inet/src",
"/mnt/c/Users/Geo/inet/src/inet",
"/mnt/c/Users/Geo/inet/src/inet/common",
"/mnt/c/Users/Geo/inet/src/inet/common/geometry/common",
"/mnt/c/Users/Geo/inet/src/inet/mobility/base",
"/mnt/c/Users/Geo/inet/src/inet/mobility/contract",
"/mnt/c/Users/Geo/inet/src/inet/mobility/single",
"${workspaceRoot}/src",
"${workspaceRoot}/src/base",
"${workspaceRoot}/src/engine",
"${workspaceRoot}/src/simple"
],
"defines": [
],
"browse": {
"path": [
"${workspaceFolder}",
"/mnt/c/Users/Geo/omnetpp-5.2/include",
"/mnt/c/Users/Geo/omnetpp-5.2/src",
"/mnt/c/Users/Geo/inet/src",
"/mnt/c/Users/Geo/gsim/slaw/src"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 4
}
@Ryuuba, can you set "C_Cpp.loggingLevel": "Debug", then open a .cpp file? The extension will log the include path that it ended up using in the Output window (select the C/C++ filter to see logging from our extension). Can you check and see what is printed there?
@bobbrow, In the log file, I actually see all paths I use in my project as well as includes/defines related to gcc. I attach the result in the following file:
log.txt
@Ryuuba Yeah, those logs look normal. This sounds like a new issue we haven't seen reported before. I'm not able to repro it so far. Does Go to Definition on #include <iostream> go to the file at "...\usr\include\c++\5"?
@sean-mcmanus yes, it does, but it does not if I use that option on an include statement to go a file that is out of ${workspaceFolder} despite the path of such file is "includePath"
We should move this to a new issue so that we don't lose it. This issue is closed.
Most helpful comment
Thank you.
After add
__cdecl=__attribute__((__cdecl__)),the problem was solved.