일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- deep learning
- supervised learning
- Machine Learning
- LG Aimers
- PCA
- 딥러닝
- ChatGPT
- gpt
- 회귀
- GPT-4
- 머신러닝
- OpenAI
- LLM
- AI
- 해커톤
- 지도학습
- LG
- 오블완
- Classification
- 분류
- LG Aimers 4th
- regression
- 티스토리챌린지
Archives
- Today
- Total
SYDev
vscode에서 C 분할 파일 빌드 및 실행 본문
https://cmaven.github.io/vscode/VS-Code-Multi-Compile/
위 게시물을 평소에 C++ 분할 파일 컴파일할 때 이용했는데, C언어 분할 파일의 경우가 없어서 임의로 추가해봤다.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"runner": "terminal",
"type": "shell",
"echoCommand": true,
"presentation" : { "reveal": "always" },
"tasks": [
//C++ 컴파일 - groups
{
"label": "save_and_compile_for_C++-groups",
"command": "g++",
"args": [
"${fileDirname}/*${fileExtname}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"group": "build",
//컴파일시 에러를 편집기에 반영
//참고: https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher
"problemMatcher": {
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
// The regular expression.
//Example to match: helloWorld.c:5:3: warning: implicit declaration of function 'prinft'
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
//C++ 컴파일 - single
{
"label": "save_and_compile_for_C++-single",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"group": "build",
//컴파일시 에러를 편집기에 반영
//참고: https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher
"problemMatcher": {
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
// The regular expression.
//Example to match: helloWorld.c:5:3: warning: implicit declaration of function 'prinft'
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
//C 컴파일 - groups
{
"label": "save_and_compile_for_C-groups",
"command": "gcc",
"args": [
"-g",
"${fileDirname}\\*.c", //모든 C 소스파일을 컴파일
"-o",
"${fileDirname}/${fileBasenameNoExtension}" //현재 열려있는 파일과 같은 이름으로 프로그램 생성
],
"group": "build",
//컴파일시 에러를 편집기에 반영
//참고: https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher
"problemMatcher": {
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
// The regular expression.
//Example to match: helloWorld.c:5:3: warning: implicit declaration of function 'prinft'
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
//C 컴파일
{
"label": "save_and_compile_for_C",
"command": "gcc",
"args": [
"${file}",
"-g -o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"group": "build",
//컴파일시 에러를 편집기에 반영
//참고: https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher
"problemMatcher": {
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
// The regular expression.
//Example to match: helloWorld.c:5:3: warning: implicit declaration of function 'prinft'
"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}"
]
}
]
}
-> C++-groups의 경우를 그대로 가져와서 label(사실 이건 안 바꿔도 무방), command(컴파일러를 gcc로), args("${fileDirname}\\*.c"로 설정해놓으면 모든 C 소스파일을 컴파일, 추가로 파일 이름과 프로그램 이름이 같아야 실행됨) 요소만 변경
참고자료