728x90
파일 -> 기본설정 -> 설정
1. 검색 : code runner terminal
-> whether to run code in~~~ 이거 체크하기
2. 검색 : executor map
settings.json 들어가면
마지막에 code-runner.exectorMap을 검색하면 자동완성을 눌러 완성해준다.
완성하면 code-runner.exectorMap에 빨간 밑줄이 그어질 수 도 있다.
그러면 앞에 콤마(,)를 찍으면 된다.
"cpp": "cd $dir && g++ -O2 -std=c++17 -static $fileName -o run.exe && run.exe",
->
-> cpp만 이렇게 변경해주고
"code-runner.runInTerminal": true,
"terminal.integrated.profiles.windows": {
"GitBash": {
"path":["D:\\Git\\bin\\bash.exe"],
"icon":"terminal-bash"
},
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
},
"terminal.integrated.defaultProfile.windows": "Command Prompt"
그 밑에 이렇게 복붙해준다.
이렇게!
그 후
3. g++ 컴파일러 다운받는 곳
https://sourceforge.net/projects/mingw/files/latest/download
4. 과정 설명해 놓은 곳
https://woogyun.tistory.com/704
다 따라서 하면
이 버튼 또는 ctrl + shift + n 으로 실행이 될것이다.
이제 드디어 vscode에서 c++을 컴파일 할 수 있다!!!
반응형