-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Replies: 1 comment · 4 replies
-
Hi @mjs225 . Could you enable the setting |
Beta Was this translation helpful? Give feedback.
All reactions
-
The hello.cpp is #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> msg {"Hello", "C++", "World", "from", "VS Code", "and the C++ extension!"};
for (const string& word : msg)
{
cout << word << " ";
}
cout << endl;
} |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @mjs225 . It looks like the extension has successfully queried the compiler, and provided an IntelliSense configuration to our IntelliSense parser that includes compiler-specific defines and includes. The only include path provided by the compiler is:
However, my own local copy of MinGW returns the following paths:
Running the equivalent of the following command against my own install of MinGW results in display of those paths. What does the following display when you run the command directly? (Note: it's likely you will need to try this command with the current working directory set to the same bin folder, or it may fail to locate certain files it needs)
If the full set of system include paths are not present, there would seem to be an issue with your installation of MinGW. Is it possible you have not install the C++ (g++, etc) components of MinGW? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Running
P.S. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I've found it's the "C_Cpp.default.systemIncludePath" in the User's settings that cause the problem. At some point, I added "D:\Program\msys64\mingw64\include" to try solving the missing header problem. After removing that, the problem disappeared. Anyway, thanks very much for your help! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've installed msvc and mingw64 gcc on my win10 machine, and only installed vscode extension "C/C++ Extension Pack" v1.1.0 with "C/C++" v1.9.8.
Cpp tools extension cannot find the standard library (say <iostream>) of mingw g++. But in quick fix, cpp tools suggest adding "D:/Program/msys64/mingw64/include/c++/11.2.0" or "D:/Program/msys64/mingw64/include/c++/11.2.0/tr1" in the includePath.
For C header <stdlib.h> in a .c file, cpp tools quick fix suggest adding "D:/Program/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32", which is the wrong path for the standard headers.
My c_cpp_properties.json is
What should I do to make cpp tools automatically include standard library headers of mingw gcc? Thanks very much!
Beta Was this translation helpful? Give feedback.
All reactions