From 201f41663aa1e4f01cceec47f6e3a5429d677244 Mon Sep 17 00:00:00 2001 From: Alex <12872500+alexmadeathing@users.noreply.github.com> Date: Mon, 9 Oct 2023 01:56:54 +0100 Subject: [PATCH] Add Troubleshooting: Unable to debug dynamically linked Bevy application in VSCode (#746) Co-authored-by: alexmadeathing --- content/learn/book/troubleshooting/_index.md | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/content/learn/book/troubleshooting/_index.md b/content/learn/book/troubleshooting/_index.md index 4d562ecf61..f8422e8e8a 100644 --- a/content/learn/book/troubleshooting/_index.md +++ b/content/learn/book/troubleshooting/_index.md @@ -20,3 +20,32 @@ Causes include: 1. Vulkan-compatible drivers not installed. To fix this, install/update the drivers. On Linux this may be `vulkan-intel` or `vulkan-radeon`. 2. Trying to run an example on a headless machine. To fix this, install a GPU! + +## Unable to debug dynamically linked Bevy application in VSCode on Windows + +```txt +The program '[10184] my-game.exe' has exited with code -1073741515 (0xc0000135). +``` + +Whilst `cargo run` may load the application successfully, running via the debugging UI in VSCode may yield the above error. This error means +that the required libraries were not loaded correctly (likely due to a pathing quirk with VSCode debug extensions on Windows). + +Edit your launch configurations in `.vscode/launch.json` so that the rust libraries are found correctly. + +For `cppvsdbg`: + +```json +"environment": [ + {"name":"PATH", "value":"%USERPROFILE%/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/bin;${workspaceFolder}/target/debug/deps;%PATH%"} + // Switch `nightly` to `stable` if you're using Rust stable +], +``` + +Or for `codelldb`: + +```json +"env": { + "PATH": "${env:USERPROFILE}/.rustup/toolchains/nightly-x86_64-pc-windows-msvc/bin;${workspaceFolder}/target/debug/deps;${env:PATH}", + // Switch `nightly` to `stable` if you're using Rust stable +}, +```