launch.json:
創(chuàng)新互聯(lián)專注于企業(yè)成都營銷網(wǎng)站建設、網(wǎng)站重做改版、龍灣網(wǎng)站定制設計、自適應品牌網(wǎng)站建設、成都h5網(wǎng)站建設、商城網(wǎng)站建設、集團公司官網(wǎng)建設、成都外貿(mào)網(wǎng)站建設、高端網(wǎng)站制作、響應式網(wǎng)頁設計等建站業(yè)務,價格優(yōu)惠性價比高,為龍灣等各大城市提供網(wǎng)站開發(fā)制作服務。2021-08-22:新版本vscode 已經(jīng)將 externalConsole 配置項標記為廢棄,更換為使用使用: "console": "integratedTerminal",
1 {
2 "version": "0.2.0",
3 "configurations": [
4 { // 對應cl.exe 5 "name": "cl.exe build and debug active file",
6 "type": "cppvsdbg",
7 "request": "launch",
8 "program": "${cwd}\out\${fileBasenameNoExtension}.exe",
9 "args": [],
10 "stopAtEntry": false,
11 "cwd": "${workspaceFolder}",
12 "environment": [],
13 "externalConsole": true,
14 "console": "integratedTerminal",
"preLaunchTask": "cl.exe build active file",
15 "logging": { // 用于消除PDB文件找不到打不開問題,來自于https://none53.hatenablog.com/entry/2019/11/28/vsCode_Cannot_find_or_open_the_PDB_file.16 "moduleLoad": false17 },
18 "presentation": {
19 "focus": true20 }
21 }
22 ]
23 }
tasks.json: 需要在項目根目錄建 out 文件夾
1 {
2 "version": "2.0.0",
3 "tasks": [
4 {
5 "type": "shell",
6 "label": "cl.exe build active file",
7 "command": "cl.exe",
8 "args": [
9 "/Zi",
10 "/source-charset:utf-8",// 源文件編碼,加上此行可以在文件中寫中文注釋也不會有IDE warning信息11 "/EHsc",
12 "/Fe:",
13 "${cwd}\out\${fileBasenameNoExtension}.exe",
14 "/Fo:",
15 "${cwd}\out\${fileBasenameNoExtension}.obj",
16 "${file}"17 ],
18 "group": {
19 "kind": "build",
20 "isDefault": true21 },
22 "presentation": {
23 "reveal": "always"24 },
25 "problemMatcher": "$msCompile"26 }
27 ]
28 }
Windows 環(huán)境變量 - >系統(tǒng)變量新建:
INCLUDE
值(按實際情況設置填值,這里是筆者安裝Visual Studio 2019后的值):
C:Program Files (x86)Windows Kits10Include10.0.18362.0ucrt;C:Program Files (x86)Windows Kits10Include10.0.18362.0um;C:Program Files (x86)Windows Kits10Include10.0.18362.0winrt;C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.27.29110include;C:Program Files (x86)Windows Kits10Lib10.0.18362.0ucrtx64;
LIB
值(按實際情況設置填值,這里是筆者安裝Visual Studio 2019后的值):
C:Program Files (x86)Windows Kits10Lib10.0.18362.0ucrtx64;C:Program Files (x86)Windows Kits10Lib10.0.18362.0umx64;C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.27.29110libx64;