Skip to content

Instantly share code, notes, and snippets.

@jungbin-kim
Created September 14, 2018 02:56
Show Gist options
  • Save jungbin-kim/f0331c7d0c5a6177fa7810050547dd84 to your computer and use it in GitHub Desktop.
Save jungbin-kim/f0331c7d0c5a6177fa7810050547dd84 to your computer and use it in GitHub Desktop.
MacOS 에서 Visual Studio Code로 C++ 설정.

MacOS 에서 Visual Studio Code로 C++ 설정하기

VSCODE 설치

$ brew cask install visual-studio-code

C/C++ Extensions 설치 및 Reload

Build 와 Run task 작성

  • Build 의 결과물인 a.out 을 Run task가 실행하는 구조

CMD + Shift + P -> Tasks:Run Task -> 실행하고자하는 task 이름 선택

#include <iostream>
#include <stdio.h>
int main(int argc, const char * argv[]) {
std::cout << "hello Visual Studio Code! :)" << '\n';
return 0;
}
{
"version": "2.0.0",
"tasks": [
{
"label": "Build hello world",
"type": "shell",
"command": "g++",
"args": [
"-g",
"helloworld.cpp"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Run hello world",
"type": "shell",
"command": "./a.out"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment