『Windows』Windows 10配置VS Code C++环境(超详细,面向小白以及大佬们)

『Windows』Windows 10 配置 VS Code C++环境(超详细,面向小白以及大佬们)

看完这个,还有下一篇:门在这
我看了网上的大佬们配的我是在是看不懂啊?我是一个小白啊?这太难了,这阻挡不了我,想使用这很骚的 IDE,于是在不断的摸索下,终于配置成功,小白们也不用慌,这次非常简单。一定可以的。
1.下载 VS Code

下载网址:https://code.visualstudio.com/

2.运行安装程序
在这里插入图片描述
一定不要忘记把 Path 那一条点上。

3.装 MinGW
当时我下了半天找不到,这次我放个地址,github 放不下这么大的文件,传文件夹的话还得 ssh 啥的,还不会,将就一下https://share.weiyun.com/5jhqiln
下载完了直接放到 C 盘根目录下,没多大,只有 600M,这样的话,就不用改我配置的路径什么的了!
在这里插入图片描述
这样就完事了,然后是配置环境变量。

4.环境变量
会配的直接跳过即可
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
找到这两个 path,用户和系统变量。
点击新建,然后输入 C:\MinGW\bin
在这里插入图片描述
这样环境变量就配置完了

检查 win+R cmd 输入 gcc -v
在这里插入图片描述
这样就配完了

5.倒数第二步
下载地址,解压出来 https://github.com/DuYuren/MinGW/tree/vscode
建个文件夹随便什么名字
把我的 .vscode 放里面
在这里插入图片描述

6.最后一步
在这里插入图片描述
然后在刚才那个文件夹里写个 C++文件,就可以编译了,F5 呦。







如果纯粹是来找 json 文件的
大佬们改改位置就能用

c_cpp_properties.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"C:/MinGW/include/*"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:/MinGW/bin/gcc.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}

launch.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"targetArchitecture": "x86",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"miDebuggerPath": "c:\\MinGW\\bin\\gdb.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"externalConsole": true,
"preLaunchTask": "g++"
}
]
}

settings.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
"files.associations": {
"vector": "cpp",
"random": "cpp",
"iostream": "cpp",
"array": "cpp",
"atomic": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cuchar": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"ratio": "cpp",
"regex": "cpp",
"set": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"scoped_allocator": "cpp",
"shared_mutex": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp"
},
"editor.fontFamily": "Consolas, 'Fira code', monospace",
"C_Cpp.errorSquiggles": "Disabled"
}

tasks.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"version": "2.0.0",
"command": "g++",
"type": "shell",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"args": ["-g", "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}



写在最后:
我叫风骨散人,名字的意思是我多想可以不低头的自由生活,可现实却不是这样。家境贫寒,总得向这个世界低头,所以我一直在奋斗,想改变我的命运给亲人好的生活,希望同样被生活绑架的你可以通过自己的努力改变现状,深知成年人的世界里没有容易二字。目前是一名在校大学生,预计考研,热爱编程,热爱技术,喜欢分享,知识无界,希望我的分享可以帮到你!
如果有什么想看的,可以私信我,如果在能力范围内,我会发布相应的博文!
感谢大家的阅读!😘 你的点赞、收藏、关注是对我最大的鼓励!


『Windows』Windows 10配置VS Code C++环境(超详细,面向小白以及大佬们)
https://chiamzhang.github.io/2024/06/29/『Windows』Windows 10配置VS Code C++环境(超详细,面向小白以及大佬们)/
Author
Chiam
Posted on
June 29, 2024
Licensed under