Skip to content

Instantly share code, notes, and snippets.

@trhgquan
Last active March 7, 2022 18:29
Show Gist options
  • Save trhgquan/a82f744fba33dd29463d28b99f22d993 to your computer and use it in GitHub Desktop.
Save trhgquan/a82f744fba33dd29463d28b99f22d993 to your computer and use it in GitHub Desktop.
VSCode C++ tasks.json to compile multiple .cpp files inside a project, output to main.exe
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "C:\\MinGW\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${workspaceFolder}\\*.cpp",
"-o",
"${fileDirname}\\main.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: C:\\MinGW\\bin\\g++.exe"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment