Build & Debug C++ on WSL 2 (Windows 11) — Visual Studio & VS Code (Step-by-Step)
Build & debug C++ on WSL 2 with Visual Studio 2022 and VS Code. In this step-by-step guide you’ll enable WSL 2, install the Linux toolchain (GCC/GDB/Ninja/CMake), create a CMake project, and debug seamlessly from Windows 11 using Visual Studio 2022, 2026, and VS Code (Remote-WSL). We’ll cover CMake Presets, selecting the WSL target in VS, and running/debugging from the Linux filesystem. #C++ #WSL2 #VisualStudio #VSCode #CMake #Windows11 You’ll learn • Enable WSL 2 and install a distro (Ubuntu shown) • Setup Visual Studio 2022/2026 for cross-platform C++ development • Install build tools: g++, gdb, ninja-build, cmake • Create a CMake project and configure CMake Presets • Build & debug in Visual Studio 2022/2026 and VSCode Applies to: ✅ Windows 11, Windows 10 ✅ Windows Server 2016—2025 ✅ Visual Studio 2022 & 2026 ✅ Visual Studio Code 1.105+ Commands and Scripts (PowerShell & BASH) GitHub: https://github.com/DariensTips/Build-Debug-C-on-WSL-2-Windows-11-Visual-Studio-VS-Code-Step-by-Step- https://github.com/DariensTips/Build-Debug-C-on-WSL-2-Windows-11-Visual-Studio-VS-Code-Step-by-Step-/blob/main/wslcppvsvc-wsl2-buildcpp-on-visualstudio-vscode.sh Chapters: 0:00 Introduction 0:22 Prepare 0:32 Prepare: Visual Studio 1:06 Prepare: Visual Studio Code 1:31 Visual Studio 2022/2026 3:34 Visual Studio Code 4:58 Install CMake Manually 6:19 Thank you for watching 6:42 Links & Resources Links & Resources: https://cmake.org/download/ https://code.visualstudio.com/docs/cpp/cmake-linux https://code.visualstudio.com/download https://learn.microsoft.com/en-us/cpp/build/walkthrough-build-debug-wsl2?view=msvc-170 https://learn.microsoft.com/en-us/visualstudio/releases/vs18/release-notes-insiders https://visualstudio.microsoft.com/downloads/ https://www.vecteezy.com/video/2043222-many-fireworks-in-event-amazing-with-black-background Glossary: WSL = Windows Subsystem for Linux IDE = Integrated Development Environment C++ = C Plus Plus (language) VSCode = Visual Studio Code CMake = Cross-platform build system GDB = GNU Debugger MSVC = Microsoft Visual C++ toolchain GCC = GNU Compiler Collection Related videos and Playlists: https://www.youtube.com/watch?v=9X0_F-Hflg8&list=PLLmyrX1SggDDmQu81Mbn5steFYcEBa_Kb&pp=iAQB https://www.youtube.com/playlist?list=PLLmyrX1SggDCIrl4pRYB18a5BfF4J4bEO Attribution: Fireworks: https://www.vecteezy.com/video/2043222-many-fireworks-in-event-amazing-with-black-background
Download
0 formatsNo download links available.