Visual Studio Code Setup for C/C++ with WSL

Поділитися
Вставка
  • Опубліковано 12 лис 2024

КОМЕНТАРІ • 39

  • @hallidori2596
    @hallidori2596 9 місяців тому +11

    My teacher in programming science made no effort helping us set up WSL, but EdgeLord, he was a hero, thank you

  • @souvlaki42
    @souvlaki42 Місяць тому +1

    You help me run my programming classes' exercises in WSL2 instead of Dev CPP. Thank you very much for that.

    • @edgelordtv
      @edgelordtv  Місяць тому

      @@souvlaki42 if you want to use a fully fledged OSS IDE, I also recommend Code::Blocks, although for most of the courses in uni, it's overkill. Working with only the text editor and gcc, you're also somewhat forced into learning other debugging tools, like gdb or valgrind, with a special mention on valgrind that saves you a lot from trying to see where seemingly random memory leaks occur.

  • @shubho5das
    @shubho5das 11 місяців тому +1

    So crisp and well explained and easy-to-flow - loved it - thank you!

  • @udesterswag
    @udesterswag 2 місяці тому +1

    My professor linked this video as a tutorial and I am so glad he did!

    • @edgelordtv
      @edgelordtv  2 місяці тому +3

      @@udesterswag I am honoured this video got so far as to be an official school resource

  • @nikolasemerdzhiev8800
    @nikolasemerdzhiev8800 9 місяців тому +1

    Singlehandedly saving my degree, thank you

  • @sijiahuang6936
    @sijiahuang6936 Рік тому +1

    Very good! Easy to follow and clean!! The coding example is also very thoughtful. Thank you for making this video!!!! I spent at least 2 hours installing and uninstalling different version of ubuntu. Turns out I just missed "build essential " part. And I just need to use "sudo apt" instead of "apt" then fixed everything!

    • @edgelordtv
      @edgelordtv  11 місяців тому

      Ubuntu and most Linux distros don't come with compilers or other debugging tools. Also "sudo" is obligatory as installing or modifying the package listing is an admin operation. Glad it helped you!

  • @prishagupta1267
    @prishagupta1267 7 місяців тому +1

    The best video on whole UA-cam

  • @valentinvalet2916
    @valentinvalet2916 Рік тому +6

    Nice vid, my programming teacher did a poor job of explaining the steps

  • @akrammohamed8374
    @akrammohamed8374 2 місяці тому

    Absolute legend

  • @AmanGupta-xn4fs
    @AmanGupta-xn4fs 4 місяці тому

    For me intellisense is not working :/, I Installed the extensions in WSL, still cpp file is not picking it up

  • @pabloqp7929
    @pabloqp7929 Рік тому

    Hey great video thanks for sharing! Now in my experience WSL performs even better if you are working directly somewhere in ~ rather than in /mnt/c/ 🎉

    • @edgelordtv
      @edgelordtv  Рік тому +1

      I am not sure about performance, but for small files and projects like those in uni, I don't think it does matter that much. I chose to do that to organize all my uni projects in the same folder.

  • @ByTobys
    @ByTobys Рік тому +2

    Did you also use CMake? If so, could you do a video how to integrate cmake into this linux environment?

    • @edgelordtv
      @edgelordtv  Рік тому +1

      I think it works just as it does on a Linux bare metal install. If you want to integrate it into VSC, then I think there are some plug-ins for that, although I have not tested it.

  • @rufus9322
    @rufus9322 Рік тому +2

    Include file not found in browse.path.

    • @edgelordtv
      @edgelordtv  7 місяців тому

      1. You might have not entered VS Code through WSL. Since gcc is installed in the WSL container, Windows cannot look into the Linux root directory. The path should be set up to lead to that.
      2. There should be an option in the C/C++ extension that needs to be set up prior. I can't seem to remember exactly but I might come with a follow up on it.

  • @z1adahmed
    @z1adahmed 2 місяці тому +1

    wow i can actually install gcc on my WSL with one command line in 5 minutes, i spent complete 1 hour trying to install it on windows dealing with tons of errors 😂😂

  • @uwu-zx5hv
    @uwu-zx5hv Рік тому

    It worked for me, but how do I open it again if I close the program? Because I have already installed another WSL, not this one, and when I click the option to open WSL it opens my old WSL, like, how do I open again the WSL from the video?

    • @uwu-zx5hv
      @uwu-zx5hv Рік тому

      Oh now I get it XD, I have to access with ubuntu terminal, is there another way other than using the linux commands? Like opening vscode normally from windows

    • @edgelordtv
      @edgelordtv  Рік тому

      @@uwu-zx5hv you could go in vscode and then open a remote session using WSL, but I got used to using the terminal

  • @kidcobra6633
    @kidcobra6633 2 місяці тому

    Thank you soooooo muchhhhh

  • @wahaggharibian6784
    @wahaggharibian6784 4 місяці тому

    why does he sound like a pilot before start XD

  • @Brunooantonelli
    @Brunooantonelli Рік тому +1

    Theme name ?

  • @jackshanvenujan3115
    @jackshanvenujan3115 9 місяців тому

    how to change the directory ?

    • @edgelordtv
      @edgelordtv  9 місяців тому

      What I do is go into the console and go into the workspace where I wanna open Code. I do that because sometimes I also have to do some configurations outside VSC.

  • @haojie1916
    @haojie1916 Рік тому

    Why it says can not open file "io stream"

    • @edgelordtv
      @edgelordtv  7 місяців тому

      1. You might have not entered VS Code through WSL. Since gcc is installed in the WSL container, Windows cannot look into the Linux root directory. The path should be set up to lead to that.
      2. There should be an option in the C/C++ extension that needs to be set up prior. I can't seem to remember exactly but I might come with a follow up on it.

  • @alexmoldoveanu9294
    @alexmoldoveanu9294 5 місяців тому

    Thanks !

  • @jvianneyjr
    @jvianneyjr Рік тому

    Can I debug my C# aplication into WSL2 ?

    • @edgelordtv
      @edgelordtv  Рік тому

      I have not coded in C# with VSCode, but as far as I'm aware debugging with C/C++ works as intended. I'm not sure however why would you work in Linux with C# because most functionality is locked behind .NET anyway, which is mostly used in Windows.

  • @eliasamaadacho3818
    @eliasamaadacho3818 Рік тому

    Ur video broke my Computer its unable to install it After i restart my Computer

  • @lukan1u
    @lukan1u 11 місяців тому

    `wsl --install` this command will do the magic for you if you're on windows 11 in windows terminal or command prompt

    • @edgelordtv
      @edgelordtv  11 місяців тому +1

      I think it works on win10 too. The single thing to mention is to search what distro you'd want to install before doing the command. 'wsl --install [distro_name]'. Some distros may not be available, so that's why I'd recommend for a new WSL user to see what's available.