1 00:00:00,000 --> 00:00:02,583 (upbeat music) 2 00:00:05,100 --> 00:00:06,660 Tutor: Hello everyone. In this video, 3 00:00:06,660 --> 00:00:08,820 I'm going to download and install 4 00:00:08,820 --> 00:00:11,760 Visual Studio Code on Linux. 5 00:00:11,760 --> 00:00:16,170 In this case, I am running Ubuntu 20.04 LTS, 6 00:00:16,170 --> 00:00:19,110 as you can see up here on the left top corner. 7 00:00:19,110 --> 00:00:20,520 Visual Studio Code is available 8 00:00:20,520 --> 00:00:22,950 for lots of Linux distributions. 9 00:00:22,950 --> 00:00:26,580 So first order of business, absolutely be sure 10 00:00:26,580 --> 00:00:29,370 that your compiler tool chain has already been installed 11 00:00:29,370 --> 00:00:30,390 and it's working. 12 00:00:30,390 --> 00:00:33,040 You can check that by opening up a terminal session 13 00:00:34,770 --> 00:00:38,320 and just typing G++-- version 14 00:00:39,180 --> 00:00:42,000 and you should get some sort of display message 15 00:00:42,000 --> 00:00:45,660 that says G++ was a version number and so forth. 16 00:00:45,660 --> 00:00:47,520 If you get an error here 17 00:00:47,520 --> 00:00:50,220 double check that your compiler is installed. 18 00:00:50,220 --> 00:00:52,080 Go back to section two of the course 19 00:00:52,080 --> 00:00:53,760 and refer to the videos there 20 00:00:53,760 --> 00:00:55,080 where I show you how to install 21 00:00:55,080 --> 00:00:57,480 your compiler tool chain on Linux. 22 00:00:57,480 --> 00:00:59,130 So I'm assuming that that's installed 23 00:00:59,130 --> 00:01:00,390 and it's all good to go, 24 00:01:00,390 --> 00:01:04,110 the next step is to actually install Visual Studio Code. 25 00:01:04,110 --> 00:01:05,519 Open up your favorite browser 26 00:01:05,519 --> 00:01:09,600 and head over to code.visualstudio.com 27 00:01:09,600 --> 00:01:12,120 and you'll see a page that looks like this. 28 00:01:12,120 --> 00:01:13,710 There are lots of distributions 29 00:01:13,710 --> 00:01:15,420 of Visual Studio Code for Linux. 30 00:01:15,420 --> 00:01:17,820 So if you click over here on the download button 31 00:01:19,290 --> 00:01:22,980 you can see we've got Debian, Ubuntu, Red Hat, Fedora 32 00:01:22,980 --> 00:01:25,830 all kinds of different distributions. What I'm gonna do 33 00:01:25,830 --> 00:01:27,300 is I'm gonna make it really easy on myself. 34 00:01:27,300 --> 00:01:29,070 I'm assuming that if you know Linux 35 00:01:29,070 --> 00:01:30,510 and if you're working with Linux, 36 00:01:30,510 --> 00:01:31,980 you know how to use package managers, 37 00:01:31,980 --> 00:01:33,600 you know how to install software. 38 00:01:33,600 --> 00:01:34,433 So what I'm gonna do 39 00:01:34,433 --> 00:01:35,670 is I'm gonna make it really easy on myself, 40 00:01:35,670 --> 00:01:38,100 I'm gonna select the Snap Store, 41 00:01:38,100 --> 00:01:39,360 that's gonna take me another page 42 00:01:39,360 --> 00:01:40,193 where I can just click 43 00:01:40,193 --> 00:01:43,800 install over here on the right top with this green button. 44 00:01:43,800 --> 00:01:45,060 And I've got a couple of choices. 45 00:01:45,060 --> 00:01:46,650 I can view it in my desktop store 46 00:01:46,650 --> 00:01:49,350 which is this guy right there, my Ubuntu software 47 00:01:49,350 --> 00:01:51,390 or I can install Snap if you like. 48 00:01:51,390 --> 00:01:53,340 If you don't have Snap installed, you can install it. 49 00:01:53,340 --> 00:01:56,280 So I'm just gonna view it in the desktop store. 50 00:01:56,280 --> 00:01:59,400 I'm gonna choose my application, which is the Ubuntu store. 51 00:01:59,400 --> 00:02:01,320 You can use Snap Store if you want. 52 00:02:01,320 --> 00:02:02,970 I'll just open the link 53 00:02:02,970 --> 00:02:05,430 and that's going to take me right here. 54 00:02:05,430 --> 00:02:07,830 Let me minimize my browser window, 55 00:02:07,830 --> 00:02:09,120 I don't need it anymore. 56 00:02:09,120 --> 00:02:12,240 And now I'm just going to install, just gonna click install, 57 00:02:12,240 --> 00:02:15,540 put in my password and that's it. 58 00:02:15,540 --> 00:02:18,300 Now it's installing Visual Studio Code. It's done. 59 00:02:18,300 --> 00:02:19,350 So what I need to do now 60 00:02:19,350 --> 00:02:23,100 is basically just close up this window and run it. 61 00:02:23,100 --> 00:02:24,630 So let me go down here 62 00:02:24,630 --> 00:02:28,140 and you should see Visual Studio Code installed now, 63 00:02:28,140 --> 00:02:30,600 there it is right here. Click on that. 64 00:02:30,600 --> 00:02:32,610 And when Visual Studio first loads up 65 00:02:32,610 --> 00:02:35,040 you'll get a screen that looks something like this. 66 00:02:35,040 --> 00:02:36,450 It's a getting started page 67 00:02:36,450 --> 00:02:39,210 with some information about opening files and so forth 68 00:02:39,210 --> 00:02:40,620 and we'll do that in a little bit. 69 00:02:40,620 --> 00:02:41,850 But before we do that 70 00:02:41,850 --> 00:02:45,060 we need to install an extension, the C++ extension 71 00:02:45,060 --> 00:02:48,720 which will allow Visual Studio Code to work with C++. 72 00:02:48,720 --> 00:02:50,910 So what we wanna do is we wanna come over here on the left 73 00:02:50,910 --> 00:02:54,450 and select these icons. This icon right here, extensions, 74 00:02:54,450 --> 00:02:56,100 you wanna select that 75 00:02:56,100 --> 00:02:57,660 and now you're gonna get a bunch of choices. 76 00:02:57,660 --> 00:03:00,450 You can see that the installed extensions are zero 77 00:03:00,450 --> 00:03:01,680 'cause I haven't installed anything, 78 00:03:01,680 --> 00:03:04,830 I've just installed Visual Studio Code fresh out of the box, 79 00:03:04,830 --> 00:03:07,170 so there are no extensions installed. 80 00:03:07,170 --> 00:03:09,840 The one we want to install is this one right here 81 00:03:09,840 --> 00:03:13,200 the C/C++ extension from Microsoft. 82 00:03:13,200 --> 00:03:14,910 It should be under popular. 83 00:03:14,910 --> 00:03:18,150 If you don't see it, you can type C++ in the search box 84 00:03:18,150 --> 00:03:21,210 and press enter and then you'll see it right away. 85 00:03:21,210 --> 00:03:23,100 So if you just select that, 86 00:03:23,100 --> 00:03:24,060 this is the one you'll know 87 00:03:24,060 --> 00:03:25,980 'cause it's this big circle with some purple, 88 00:03:25,980 --> 00:03:29,280 white and black, and it says C/C++ Microsoft 89 00:03:29,280 --> 00:03:31,140 with just over 20 million downloads 90 00:03:31,140 --> 00:03:33,900 at the time of this recording. That's the one we want. 91 00:03:33,900 --> 00:03:36,150 We want to select install, 92 00:03:36,150 --> 00:03:37,320 and you'll see the installation 93 00:03:37,320 --> 00:03:39,630 proceed down here on the right. 94 00:03:39,630 --> 00:03:42,840 Once it's finished, we are good to go. 95 00:03:42,840 --> 00:03:44,520 So we just give it a few minutes to finish, 96 00:03:44,520 --> 00:03:46,770 don't interrupt it, just let it do its thing. 97 00:03:49,590 --> 00:03:51,150 Okay, so it's done. 98 00:03:51,150 --> 00:03:52,390 We'll close this up 99 00:03:53,670 --> 00:03:58,500 and we will go back here to explore and we're good to go. 100 00:03:58,500 --> 00:04:00,180 So the next thing we're going to do is 101 00:04:00,180 --> 00:04:01,440 we're gonna create a folder 102 00:04:01,440 --> 00:04:03,690 and inside that folder we're gonna create a project 103 00:04:03,690 --> 00:04:07,770 which is gonna include a new simple C++ program 104 00:04:07,770 --> 00:04:10,830 that will allow us to configure Visual Studio Code 105 00:04:10,830 --> 00:04:14,250 so that we'll build, run, and debug that file. 106 00:04:14,250 --> 00:04:16,500 So I'll see you in the next video to do that.