VsCode
VS code visual studio code ์ฌ์ฉ๋ฒ ๊ฐ๋ฐํ๊ฒฝ C / C++ ์ปดํ์ผ๋ฌ gcc ํน์ mingw ์ค์น๊ฐ ํ์ํ๋ค. ์ธํฐ๋ท์์ ์ค์นํ๋๋ก ํ๋ค. ์ค์ ํ์ผ ์ปดํ์ผ ๋ฐ ์คํ์ ์ํด์๋ launch.json, setting.json, tasks.json ํ์ผ์ด ํ์ํ๋ค. vs code์์ ์์์ ์์ฑํด ์ฃผ์ง๋ง, ๊ธฐ๋ณธ ์ค์ ์ผ๋ก ๋ถ์กฑํ ๋ถ๋ถ์ ์์ ํด์ผ ํ๋ค. # settings.json { "C_Cpp_Runner.cStandard": "", "C_Cpp_Runner.cppStandard": "", "C_Cpp_Runner.msvcBatchPath": "", "C_Cpp_Runner.warnings": [ "-Wall", "-Wextra", "-Wpedantic" ], "C_Cpp_Runner.enableWarnings": true, "C_Cpp_Runner.warningsAsError": false, "C_Cpp_Runner.compilerArgs": [], "C_Cpp_Runner.linkerArgs": [], "C_Cpp_Runner.includePaths": [], "C_Cpp_Runner.includeSearch": [ "*", "**/*" ], "C_Cpp_Runner.excludeSearch": [ "**/build", "**/build/**", "**/.*", "**/.*/**", "**/.vscode", "**/.vscode/**" ], "C_Cpp_Runner.cCompilerPath": "gcc", "C_Cpp_Runner.cppCompilerPath": "C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/g++.exe", "C_Cpp_Runner.debuggerPath": "C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gdb.exe", "files.associations": { "hash_map": "cpp" } } # launch.json { "version": "0.2.0", "configurations": [ { "name": "C/C++ Runner: Debug Session", "type": "cppdbg", "request": "launch", "args": [], "stopAtEntry": false, "cwd": "f:/Documents/GitHub/acmicpc/15997", "environment": [], "program": "๋์์ํฌ ํ๋ก๊ทธ๋จ ๊ฒฝ๋ก", "internalConsoleOptions": "openOnSessionStart", "MIMode": "gdb", "miDebuggerPath": "C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gdb.exe", "externalConsole": false, "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] } # tasks.json { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "type": "shell", "label": "execute", "command": "${fileDirname}/${fileBasenameNoExtension}.exe", "group": { "kind": "test", "isDefault": true }, "problemMatcher": [] }, { "type": "cppbuild", "label": "C/C++: g++.exe ํ์ฑ ํ์ผ ๋น๋", "command": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\g++.exe", "args": [ "-fdiagnostics-color=always", "-g", "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$gcc" ], "group": "build", "detail": "์ปดํ์ผ๋ฌ: \"C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\g++.exe\"" } ] } ๋จ์ถํค Ctrl + Shift + P ๋จ์ถํค๋ก ๋ช ๋ น์ ์ผ์ผ์ด ์ํํด๋ ๋์ง๋ง, ๋จ์ถํค๋ฅผ ์ค์ ํด ๋ฐ๋ก ์คํํ๋๊ฒ ๋น ๋ฅด๋ค. ํ์ผ -> ๊ธฐ๋ณธ์ค์ -> ๋ฐ๋ก๊ฐ๊ธฐํค (Ctrl + K & Ctrl + S) ๋ฅผ ๋๋ฅด๊ณ , ์ฐ์ธก ์๋จ โ๋ฐ๋ก๊ฐ๊ธฐ ํค ์ด๊ธฐโ ๋ฅผ ํด๋ฆญํ์ฌ ๋จ์ถํค๋ฅผ ์ง์ ์ ๋ ฅํ๋ค. // ํค ๋ฐ์ธ๋ฉ์ ์ด ํ์ผ์ ๋ฃ์ด์ ๊ธฐ๋ณธ๊ฐ ์ฌ์ ์ [ { "key": "ctrl+alt+c", "command": "workbench.action.tasks.build", }, { "key": "ctrl+alt+e", "command": "workbench.action.tasks.test", } ]