Skip to content

Instantly share code, notes, and snippets.

@RednibCoding
Last active April 18, 2025 07:09
Show Gist options
  • Save RednibCoding/0c2258213a293a606542be2035846a7d to your computer and use it in GitHub Desktop.
Save RednibCoding/0c2258213a293a606542be2035846a7d to your computer and use it in GitHub Desktop.
Odin debugging on windows with vscode. See: readme

Setup

To setup debugging for Odin programs on Windows with VsCode follow these steps:

  • make sure you have the C/C++ extension pack (VsCode extension) installed
  • create a .vscode folder at the root of your Odin project
  • copy the launch.json and tasks.json into it
  • click on the debug tab in VsCode, then click on the debug button at the top (or press F5)

Note: if you want to use a starter template which also sets up a tracking allocator which tracks and reports memory leaks you can use: https://github.com/RednibCoding/Odin-Starter

FAQ

Q: When I start debugging, I get the following error popup: Configured debug type 'cppvsdbg' is not supported.

A: Make sure you have the C/C++ extension pack installed. If it is already installed, try reinstalling it.

{
"version": "0.2.0",
"configurations": [
{
"type": "cppvsdbg",
"request": "launch",
"preLaunchTask": "Build",
"name": "Debug",
"program": "${workspaceFolder}/build/debug.exe",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
{
"version": "2.0.0",
"command": "",
"args": [],
"tasks": [
{
"label": "mkdir",
"type": "shell",
"command": "cmd",
"args": [
"/C",
"if not exist .\\build mkdir .\\build"
]
},
{
"label": "build",
"type": "shell",
"command": "odin build . -debug -out:build/debug.exe",
"group": "build"
},
{
"label": "Build",
"dependsOn": [
"mkdir",
"build"
]
}
]
}
@williamtwilson
Copy link

Incredible, thank you! One thing to note is that people may run into a permissions issue the first time before .\build exists, but running a second time clears it up!

@shanestevens
Copy link

SO good! Thankyou for this, I was going mad finding a way to do this with CoPilot! I wish there was a Mac version of this.

@diocletiann
Copy link

SO good! Thankyou for this, I was going mad finding a way to do this with CoPilot! I wish there was a Mac version of this.

there is, codelldb

@sepehrkiller
Copy link

Thank you

@Bankaru
Copy link

Bankaru commented Mar 11, 2025

Thank you so much

@Rythmyr47
Copy link

Ive been trying to solve this issue for a while and havent had any luck. When running my code i get the following error, and was wondering if you had any knowledge in how to fix it. If I was to run 'odin run .' in the terminal however, my code will run, so im quite unsure of the discrepency here. Thanks in advance.

  • Executing task in folder my-game-1: odin build . -debug -out:build/debug.exe

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment