Install and Debug C/C++ in WSL via Visual Studio Code | Windows Subsystem for Linux

preview_player
Показать описание
#gcc #c #c++ #wsl #debug
Run C/C++ in WSL

Set up your Linux environment-:
1) Set up your Linux environment-:
-search and goto wsl installed distro cmd
-sudo apt-get update
-sudo apt-get upgrade
-sudo apt-get install build-essential gdb
-navigate to the directory and run ```code .``` to open vs-code
2)VS code setup
-Install C/C++ extension
-Write a C/C== Program and save
-Go to terminal ➡️ Configure Default build task (ctrl+shift+b)
-navigate to c/c++ file workspace in vscode (important)
-Go to run ➡️ add configuration
-F5 to run and debug
Comment Your doubts below

Рекомендации по теме
Комментарии
Автор

Note: to install WSL in windows 11
Open cmd(administrator)
wsl --install -d <Your distribution>

pratikdevdas
Автор

Thank you very much bro. I had such a big problem with the WSL, debian, vscode and C stuff. In the end, the codes wasn't executing neither debuggin. You helped me a lot!

aocubo
Автор

I continued with your process, but in the case of add configuration, it gives me the options gdb attach, gdb launch, ... and it can be run.
enter program name, for example...

زهراخیراللهی
Автор

hi I am working on the same. while compilation getting issue is local host time out

mallinaidukarpurapu
join shbcf.ru