diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..cabd2b2 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,29 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "g++.exe build and debug active file", + "type": "cppdbg", + "request": "launch", + "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin\\gdb.exe", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "g++.exe build active file" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..052e281 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,19 @@ +{ + "tasks": [ + { + "type": "shell", + "label": "g++.exe build active file", + "command": "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin\\g++.exe", + "args": [ + "-g", + "${file}", + "-o", + "${fileDirname}\\${fileBasenameNoExtension}.exe" + ], + "options": { + "cwd": "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin" + } + } + ], + "version": "2.0.0" +} diff --git a/README.md b/README.md index a2407d3..f563c81 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ -# vscode chocolatey cpp +# Using C++ in VS Code using Chocolatey -launch.json and task.json for C++ in Visual Studio Code using Chocolatey \ No newline at end of file +## Steps + +1. [Install MinGW using chocolatey](https://chocolatey.org/packages/mingw). +2. Copy contents of `.vscode` folder into working directory. +3. Press `F5` to debug or `ctrl-F5` to compile and run without debugging. +4. ??? +5. Profit. + +## Disclaimer + +These instructions are more for me so I don't have to reinvent the wheel anytime I reset my PC. So, don't expect any help from me when this doesn't work for you ♥ \ No newline at end of file