Debug Multi-File C++ Programs in VS Code and WSL (Windows)

preview_player
Показать описание
tldr:
1) Put all your project code files into a single folder, and only have one main function.
2) Try debugging as normal to generate the .vscode folder and .json files

That's it. It should compile and catch your breakpoint. If you get an error of "redeclaration of main," that means you need to adhere to step 1, above.
Рекомендации по теме
Комментарии
Автор

I like the way you start the video with what will happen if the viewer stops watching now. Then going on to show the solution. So much better than "show them what you are going to tell them, tell them, show them what you just told them.". Excellent video, thank you.

willofirony
Автор

Thanks man this literally helped so much tried many ways but this worked and moreover your interaction in the comment solved my problem.😄😄

parasrawat
Автор

I extremely thanks to you since I stuck with this concept 3-4 hours and then I can get along with it😊

thanhcong
Автор

I cannot express how much appreciation I have for this man rn !

rajraikar
Автор

Thank you for making this video. I was going to give up on using the debugger XD. You have saved me hours of manual debugging

keshavgopinath
Автор

I cannot like this video enough. I messed around with CMAKE, and all kinds of other videos and this was the one that helped!

ALBOIN
Автор

Thank you so much, finally found a tutorial that makes sense.

spadezap
Автор

Thanks! I was trying to figure out a solution for hours!

khaixa_
Автор

The video is very clear. The solution is neat and simple.

jzhang
Автор

I signed in to like this video just because of the description. Tysm

mikoajczermak
Автор

Wow thank you so much ! I knew there was something wrong in the preLaunchTask command but couldn't figure out what exactly...

iljastepanov
Автор

I've been searching for 2 days for a solution ....thanks a lot

ahmedosama
Автор

thank you man, I'm a noob in vscode and those .json files scared me, you save me.

diegomora
Автор

YES!!!! IT WORKED!!! THANK YOU SO MUCH!

summerishere
Автор

Unfortunately this method doesn't work on Ubuntu Linux.

djura
Автор

How to use a single header file with multiple source files? Like we do in Codeblocks? If that's possible...

ayushdubey
Автор

but how do i do if i have files on different folders
eg . header files on a folder named "include"
driver on " src" and output on "build"?

anishmanandhar
Автор

Excelent video but I have a question: when i click on the green box in the bottom left corner saying "WSL: Ubuntu", it doesn't give me the option "Reopen Folder with WSL". Do I need to install something? Thank you.

diogofranco
Автор

Thanks for the video, I have been searching for the same solution.
I am wondering how to work with subfolders with multiple files? is it possible? instead of *.cpp can we put something else to consider subfolder cpp files?

kvnptl
Автор

For me it doesn't work. I'm on Windows OS

pinielchitare