Skip to content

Commit 2001e92

Browse files
authored
Create MinGW.md
1 parent 1a37e74 commit 2001e92

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
For developers using MinGW on Windows, we recommend you start with the following **c_cpp_properties.json** template. Select "C/Cpp: Edit Configurations" from the command palette to create this file if you haven't already.
2+
3+
```
4+
{
5+
"configurations": [
6+
{
7+
"name": "Win32",
8+
"intelliSenseMode": "clang-x64",
9+
"includePath": [
10+
"${workspaceRoot}",
11+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++",
12+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++/mingw32",
13+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++/backward",
14+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include",
15+
"C:/MinGW/include",
16+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include-fixed"
17+
],
18+
"defines": [
19+
"_DEBUG",
20+
"UNICODE"
21+
],
22+
"browse": {
23+
"path": [
24+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include",
25+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include-fixed",
26+
"C:/MinGW/include/*"
27+
],
28+
"limitSymbolsToIncludedHeaders": true,
29+
"databaseFilename": ""
30+
}
31+
}
32+
]
33+
}
34+
```
35+
36+
The `includePath` above includes the system header paths that gcc uses in version 5.3.0 for C++ projects and matches the output of `gcc -v -E -x c++ -`. The `intelliSenseMode` should be set to **"clang-x64"** to get MinGW projects to work properly with IntelliSense.
37+
38+
For C projects, simply remove the c++ lines:
39+
40+
```
41+
{
42+
"configurations": [
43+
{
44+
"name": "Win32",
45+
"intelliSenseMode": "clang-x64",
46+
"includePath": [
47+
"${workspaceRoot}",
48+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include",
49+
"C:/MinGW/include",
50+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include-fixed"
51+
],
52+
"defines": [
53+
"_DEBUG",
54+
"UNICODE"
55+
],
56+
"browse": {
57+
"path": [
58+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include",
59+
"C:/MinGW/lib/gcc/mingw32/5.3.0/include-fixed",
60+
"C:/MinGW/include/*"
61+
],
62+
"limitSymbolsToIncludedHeaders": true,
63+
"databaseFilename": ""
64+
}
65+
}
66+
]
67+
}
68+
```
69+
70+
With these configurations, you should be all set up to use the new IntelliSense engine for linting, memberlist autocomplete, and quick info (tooltips). Add `"C_Cpp.intelliSenseEngine": "Default"` to your **settings.json** file to try out the new IntelliSense engine.

0 commit comments

Comments
 (0)