Skip to content

Instantly share code, notes, and snippets.

@RednibCoding
Last active June 24, 2025 17:49
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"
]
}
]
}
@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.

@FROSTdrgn
Copy link

For people on linux, cppvsdbg doesn't work, but lldb works fine (I used the more frequently installed extension for lldb, vadimcn.vscode-lldb; note that there's another more official one)

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "preLaunchTask": "Build",
            "name": "Debug",
            "program": "${workspaceFolder}/build/game.bin",
            "args": [],
            "cwd": "${workspaceFolder}"
        }
    ]
}

I use make so keeping it simple,

{
    "version": "2.0.0",
    "command": "",
    "args": [],
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "make build",
            "group": "build"
        }
    ]
}

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