Install and Run C++ in Visual Studio Code (Linux)

Sdílet
Vložit
  • čas přidán 5. 09. 2024
  • Covers how to do the following under Linux (Ubuntu):
    - Install G++ and GDB
    - Install VS Code
    - Open a workspace for multiple activities (labs / assignments)
    - Compile and run from within VS Code

Komentáře • 146

  • @tomplaner1488
    @tomplaner1488 Před 3 lety +146

    Dr. Fraser. Thank you for what you are doing. I am 81 years old. I have, for many years, wanted to learn some basics about programming. I shall be following your site.

  • @Mike-cu3kj
    @Mike-cu3kj Před 3 lety +35

    I can't thank you enough for this. I've spent about 20 hours trying to get c++ to compile and run on vscode linux. Now it finally works. Thank you sooo much for this

  • @Beryesa.
    @Beryesa. Před 3 lety +17

    Man, your voice is relaxing. :D I don't know but feels like more polite lol :D

  • @ai.shimul
    @ai.shimul Před 3 lety +4

    finally got vs code up and running in debian... hats off to you, sir 😄

  • @hennero.3826
    @hennero.3826 Před 8 měsíci

    Thank you very much! Following these instructions, I could easily get the C++ compiler (g++) running in my existing VS Code that I had installed a few weeks ago to use PlatformIO. 🙂
    As I am new to VS Code and therefore not familiar yet with how the use the different extensions, I appreciate especially the valuable information you provided regarding starting the IDE from the command line! This allows me to simply start the software from either a folder containing PlatformIO projects or a folder that I am using for the C++ stuff.🙂

  • @peterhuesmann3956
    @peterhuesmann3956 Před 2 lety

    Another person thanking you here. I have been away a couple years from trying to get back into coding. This saved me a lot of time to get started with VS Code in Linux.

  • @parasjain1489
    @parasjain1489 Před 2 lety +3

    Thank you so much. I am a coder and I was struggling with this for half an hour and your solution worked. Thanks again.

  • @mhougey
    @mhougey Před 3 lety +2

    thank you for including a section about things that can go wrong.

  • @camdenmacleod16
    @camdenmacleod16 Před 3 lety +3

    Super helpful! I followed a website tutorial but it didn't work for me, so thanks for making this!

  • @harshvardhan7447
    @harshvardhan7447 Před 3 lety +1

    Classic code is not working
    Error showing

  • @wokeclub1844
    @wokeclub1844 Před rokem +1

    If anyone has #include errors, try changing clang to g++ in the json file

  • @ritchielrez1680
    @ritchielrez1680 Před 3 lety +3

    You can install Vscode from snap store without the terminal.

    • @parthsalat
      @parthsalat Před 3 lety +1

      Agreed, the ubuntu store is a great place for beginners

  • @thegettokidZz
    @thegettokidZz Před 3 lety +2

    mine just opens an empty json without anything inside except for my theme. the little suggestion bar doesn't do after i select GDB/LLDB just opens the empty json file in settings.json

    • @vivekpatil2930
      @vivekpatil2930 Před 3 lety

      same, if you fix the problem please let me know.

    • @thegettokidZz
      @thegettokidZz Před 3 lety +1

      if you still have this problem it's probably because you're in the wrong json file. You need to switch to the configuration json instead of the settings.json

  • @ayeshaabbasi1871
    @ayeshaabbasi1871 Před 2 lety

    Thanks a lot man I was struggling with vs code for quite long time but can't understand anything and your video worked like a magic✨

  • @rahulsriram6295
    @rahulsriram6295 Před 4 lety +5

    Sir, I watched all your videos. There's no particular tutorial on CZcams about setting up an IDE or Editor for programming in Assembly. Every CS student has to go through assembly programming. I hope you'd make a tutorial soon

    • @zuhail339
      @zuhail339 Před 3 lety

      Try to study Art of assembly language book

  • @qpandrei01
    @qpandrei01 Před 3 lety

    Definitely recommend this tut fixed to topic and precise. Nothing more just go with this one

  • @leythecg
    @leythecg Před 3 lety +2

    Great Tutorial! It works finally on my Mint 20! Thanks so much!

  • @technologyexplained
    @technologyexplained Před 2 lety +2

    hello, this tutorial is amazing. But I have an issue regarding the installation of classic code. I have a Mac of which the architecture is M1, and therefore it is giving the error:
    snap "code" is not available on stable for this architucture (arm64) but exists on other architectures (amd64)
    what should I do??

  • @usuallyclueless4477
    @usuallyclueless4477 Před 2 lety

    Just a little correction, installing snap alone didn't work because it said " sudo: snap: command not found"
    It worked after installing snapd after it.

  • @clickjack8011
    @clickjack8011 Před 2 lety

    Thanks alot man, you helped me get past hours worth of hassle.

  • @navpreet902
    @navpreet902 Před 3 lety

    I am from India Thanku very much it helped me alot

  • @Bearded_Dragon_Sir
    @Bearded_Dragon_Sir Před 2 lety

    Setting the environment doesn't work for me, all it does it open a .json settings file and then when i try to run it again it does the same thing all over.

  • @moonrise_beatrix
    @moonrise_beatrix Před 2 lety +1

    thank you for this tutorial .. it was
    so easy to understand and super useful!

  • @mute3164
    @mute3164 Před 2 lety

    Thank you so much, I tried searching for it but none of the articles I found explained as clearly as your video.

  • @raghavendra6978
    @raghavendra6978 Před 3 lety +1

    Thanks a lot for your simplest tutorial 🙏🙏

  • @usamamuhammadismail3324

    I really appreciate this video. Love from Pakistan.

  • @zlobert9877
    @zlobert9877 Před rokem

    Only thing that is different on my system(linux mint) is that the "[1] + done" is on the same line(no spacing between) as the string i printed out. Would like to change that.

  • @stroherdebora
    @stroherdebora Před 3 lety +2

    Thanks man! That was very helpful!

  • @nunyobidness571
    @nunyobidness571 Před 2 lety

    Why does VS Code automatically create the launch.json file here? Is there some sort of add-on that does it? Mine only creates a tasks.json file.

  • @shahanahmedkhan6101
    @shahanahmedkhan6101 Před rokem

    Love you brother, you made it simple

  • @themuhammad1
    @themuhammad1 Před 2 lety

    Hi i need help setting up VS code for C++ windows executable apps but I use Ubuntu not Windows

  • @vladimirscekic4935
    @vladimirscekic4935 Před 3 lety

    Thank you for this video, can i ask you: how setting/use hot keys for the compilier in VScode? If i want use keybord for the start programm.

  • @ottodvalishvili7601
    @ottodvalishvili7601 Před 4 lety

    Great video. Btw what computer glasses are u wearing?

  • @fernandobarbosa25
    @fernandobarbosa25 Před 2 lety

    Extremely helpful and didactic! Thanks!

  • @Basti1987chiller
    @Basti1987chiller Před 2 lety

    Very good explaination thank you Professor Fraser

  • @sivaranjani-37
    @sivaranjani-37 Před rokem

    Thank you so much for this kind of video

  • @ebiscaia
    @ebiscaia Před 3 lety

    Thanks. Followed your instructions in Manjaro Linux and used clang instead

  • @royjr.8965
    @royjr.8965 Před 2 lety

    Hi Brian, thanks for this super helpful video.
    Just a problem I'm facing: I'm having to choose the environment (g++) every time I hit F5 not sure why? Any suggestions? thanks again!!

  • @Xiahab
    @Xiahab Před 3 lety +1

    This cool. You are the best!

  • @edwardonsax9919
    @edwardonsax9919 Před 3 lety

    I have a permissions issue. My .c file compile/build but when I run them they all say permission denied. This is what shows in the xterm that pops up. Even after I set the chmod +x or even 788 I still get this. What do I need to do? It does this whether in sh, bash, or csh

  • @kubakakauko
    @kubakakauko Před 4 lety

    How would one add includes, Libs and inherit from other files ?

  • @duyviet5801
    @duyviet5801 Před rokem

    YOU SAVE MY LIFE! THANK YOU!

  • @mritunjay7065
    @mritunjay7065 Před 3 lety

    Very helpful video for beginners like me !

  • @timmartin6493
    @timmartin6493 Před 3 lety

    Thank you video was helpful second time!!!

  • @lukmanalghdamsi3189
    @lukmanalghdamsi3189 Před rokem

    for some reason my pc download "lunch.json" configuration empty, so i had to write the configuration from you in 7:57. it works now but i don't know why that happened. i am using pop os

  • @beast4000
    @beast4000 Před 3 lety +2

    Thanks for the info!!

  • @adamasimolowo8285
    @adamasimolowo8285 Před 2 lety

    When I run C++ code to compile, my system freezes for a bit before I see any output in the terminal. After the compilation, my system(the VM image I'm using) ends up very laggy. I'll find a fix for this, but seems like it's an issue with the RAM and/or CPU.

  • @pwabhee0292
    @pwabhee0292 Před 3 lety

    Thank you so much. It was very helpful.

  • @Techtrendsgadget
    @Techtrendsgadget Před 3 lety

    thanku very much, for such type of knowledge.

  • @mayamenaifi6031
    @mayamenaifi6031 Před 2 lety

    Finally.. It worked

  • @kodizhuk
    @kodizhuk Před 3 lety

    thanks, it helps a lot for starting

  • @johnadams9418
    @johnadams9418 Před 2 lety

    thank's man, you've very helped me.

  • @badrelkholy8036
    @badrelkholy8036 Před 3 lety

    Thank you so much, it was really helpful

  • @sinanozsahin8138
    @sinanozsahin8138 Před 2 lety

    Thank you very much.. It's very helpful for me..

  • @mrhunter7382
    @mrhunter7382 Před 3 lety

    hello sir,,I wana specify that i will debug with c++17 in vscode. than how to set??i wish u will make a video

  • @shokhrukhbekyursunjonov6203

    Thank you very much, it really worked bro!

  • @ZgavY
    @ZgavY Před 3 lety

    I installed vsc without g++ and It wouldn't run my hello world. Is that it? If I install g++ will it work?

  • @abdulbaricou
    @abdulbaricou Před rokem

    it works with kali linux kindly guide me

  • @akashappu7550
    @akashappu7550 Před rokem

    What is( [1] +done )mean?

  • @santiagoeguren8310
    @santiagoeguren8310 Před 3 lety

    Excellent tutorial!!!!

  • @joaopedromarques1549
    @joaopedromarques1549 Před 2 lety

    Hello, thank you for help me. You gained one more subscriber Brazilian

  • @sudhansumtripathy
    @sudhansumtripathy Před 2 lety

    can we stop the automatic generation of the .exe file

  • @shoaibishaqkhan4745
    @shoaibishaqkhan4745 Před rokem

    love you brother....

  • @mr.attila28
    @mr.attila28 Před 3 lety

    You didn't include apt install gdb ! some ppls can have truble with that !

  • @sweetjj8530
    @sweetjj8530 Před 3 lety

    Sir really thank you. You are awesome

  • @marcelocorrea9830
    @marcelocorrea9830 Před 2 lety

    Excelente explicação! Muito obrigado!

  • @vahemuradyan7258
    @vahemuradyan7258 Před 2 lety

    thank you that helps a lot

  • @daniellima3730
    @daniellima3730 Před 3 lety

    Thanks for the video!

  • @celestialadministration

    How do you get the updated 10.02

  • @vivarantx
    @vivarantx Před 2 lety

    great video man

  • @kumarnishant6635
    @kumarnishant6635 Před 3 lety

    Thanks, helped a lot

  • @harshit741
    @harshit741 Před 3 lety +1

    at 7:51 , i can see only two options, ie, cpp build and debug active files,, no option for g++, what shall i do?

  • @kamalsharma3289
    @kamalsharma3289 Před 3 lety

    thanks bro it really help me

  • @joshvafranklin7038
    @joshvafranklin7038 Před 3 lety

    Thanks man . Till now I thought
    Hello world " [1] + Done" was due to error.

  • @hanzalamansoor
    @hanzalamansoor Před 3 lety

    I got a message : unable to locate gdp

  • @rum5117
    @rum5117 Před 2 lety

    Love you!

  • @udayanmajumder474
    @udayanmajumder474 Před 3 lety

    tnks its very helpful

  • @apriantohendri999
    @apriantohendri999 Před 3 lety

    i got doesnt exist message? help

  • @nguyencung2269
    @nguyencung2269 Před 3 lety

    Thank you very much!

  • @rabeehMadathil001
    @rabeehMadathil001 Před 2 lety

    thank you sir god bless you

  • @scotteebee
    @scotteebee Před 2 lety

    Why don’t you show how to develop with more than one .cpp file? Nobody uses a single .cpp file in real life.

  • @gassinbeats1156
    @gassinbeats1156 Před 3 lety

    2:17
    *holding my breath*
    me: don’t do it! STOP! don’t do it
    That was close

  • @mayurghuge8846
    @mayurghuge8846 Před rokem

    Thank you.

  • @speconcloud9
    @speconcloud9 Před rokem

    Thankyou so much

  • @jaquelineabreu861
    @jaquelineabreu861 Před rokem

    Me ajudou muito! Obrigada! :D

  • @Roman-uy7qp
    @Roman-uy7qp Před 3 lety

    Great video :)

  • @abdelaziz2788
    @abdelaziz2788 Před 2 lety

    omg linux is so much simpler and cleaner than windows

  • @marciocintra2988
    @marciocintra2988 Před 3 lety

    awesome tutorial, +1 sub

  • @calin-andreipantis-simut6241

    Thank you!

  • @ronaldlogan3525
    @ronaldlogan3525 Před 3 lety

    I could not get it to work. followed your instructions exactly. I suspect you don't really know how to do it

  • @sunglevan8343
    @sunglevan8343 Před 2 lety

    thank you

  • @anishchauhan4127
    @anishchauhan4127 Před 3 lety

    Thank you soooo muchh sir ❤️

  • @budstawudsta9115
    @budstawudsta9115 Před 3 lety

    thank you so much

  • @csjoy4682
    @csjoy4682 Před 3 lety

    Thanks Much

  • @slaozeren8742
    @slaozeren8742 Před 3 lety

    I love you!

  • @aryanarya8
    @aryanarya8 Před 2 lety

    Super Helpful Sir!

  • @market_advice266
    @market_advice266 Před 3 lety

    thanks man

  • @fredricksolomonm7363
    @fredricksolomonm7363 Před 3 lety

    Thanks!!!!

  • @TekhneWithHomayoon
    @TekhneWithHomayoon Před 2 lety

    best

  • @Thiago-rr5kz
    @Thiago-rr5kz Před 2 lety

    obrigado