정처기 실기 공부하던 중에
한 번도 해보지 않은 c가 나와서
이김에 한 번 코드라도 따라 쳐보려고 c를 설치하고자 한다.
설치 후 이렇게 4개 체크하기
-> Installation에서 적용시켜주기
생성된 파일의 내용을 전부 지우고
{
"version": "2.0.0",
"runner": "terminal",
"type": "shell",
"echoCommand": true,
"presentation": {
"reveal": "always"
},
"tasks": [
{
"label": "save and compile for C++",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"group": "build",
"problemMatcher": {
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "save and compile for C",
"command": "gcc",
"args": [
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"group": "build",
"problemMatcher": {
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "execute",
"command": "cmd",
"group": "test",
"args": [
"/C",
"${fileDirname}\\${fileBasenameNoExtension}"
]
},
{
"type": "cppbuild",
"label": "C/C++: gcc.exe 활성 파일 빌드",
"command": "C:\\MinGW\\bin\\gcc.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "디버거에서 생성된 작업입니다."
},
{
"type": "cppbuild",
"label": "C/C++: g++.exe 활성 파일 빌드",
"command": "C:\\MinGW\\bin\\g++.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
// "group": {
// "kind": "build",
// "isDefault": true
// },
"detail": "디버거에서 생성된 작업입니다."
},
{
"type": "cppbuild",
"label": "C/C++: gcc.exe 활성 파일 빌드",
"command": "C:\\MinGW\\bin\\gcc.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
// "group": {
// "kind": "build",
// "isDefault": true
// },
"detail": "컴파일러: C:\\MinGW\\bin\\gcc.exe"
}
]
}
이렇게 입력해주기
// 키 바인딩을 이 파일에 넣어서 기본값 재정의
[
// 컴파일
{
"key": "ctrl+alt+c",
"command": "workbench.action.tasks.build"
},
// 실행
{
"key": "ctrl+alt+r",
"command": "workbench.action.tasks.test"
}
]
설정해주기
다시 바로가기 키 탭으로 돌아와서
Ctrl + alt + c와 Ctrl + alt + r을 검색했을 때 잘 나오면 된 것 !!