1. 명령 팔레트 열기 Ctrl + Shift + p

 

팔레트

 

2. task 입력 후 '작업 : 기본 작업 빌드 구성' (Tasks: Configure Default Build Task) 실행

 

기본 빌드 작업 구성

 

3. '템플릿에서 tasks.json 파일 만들기' 선택

 

Make tasks.json

 

4. 'Others 임의의 외부 명령을 실행하는 예' 선택

 

Others

 

5. json 파일 편집

관련 자료 : https://code.visualstudio.com/docs/editor/tasks

 

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
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version""2.0.0",
    "tasks": [
        {
            "label""echo",
            "type""shell",
            "command""echo Hello"
        },
        {
            "type""shell",
            "label""gcc.exe build active file",
            "command""gcc",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind""build",
                "isDefault"true
            }
        },
        {
            "type""shell",
            "label""g++.exe build active file",
            "command""g++",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind""build",
                "isDefault"true
            }
        },
        {
            "type""shell",
            "label""Run",
            "command""${fileDirname}\\${fileBasenameNoExtension}.exe",
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind""test",
                "isDefault"true
            }
        }
    ]
}
cs

 

6. 파일 -> 기본설정 -> 바로 가기 키 -> '작업: 빌드 작업 실행'

 

Ctrl+Shift+b

 

7. 작업: 테스트 작업 실행

 

Ctrl+Alt+r

'useful' 카테고리의 다른 글

Visual Studio Code C/C++ Setup  (0) 2023.08.13
[Git] Remove local branch  (0) 2022.12.12
Add weather into google calendar  (0) 2022.09.18
Cannot resolve symbol 'Properties'  (2) 2022.09.09
flutter SDK version error  (0) 2022.09.05

+ Recent posts