1 00:00:05,400 --> 00:00:09,800 In this video, we're going to install the c++ compiler 2 00:00:10,100 --> 00:00:13,300 as well as CodeLite on ubuntu Linux. 3 00:00:13,300 --> 00:00:16,300 Now the version of ubuntu Linux that I'm running, 4 00:00:17,300 --> 00:00:18,800 I'll show you right here, 5 00:00:20,000 --> 00:00:23,660 this is version 18.04.4. 6 00:00:23,660 --> 00:00:26,360 This is the latest and greatest at the time of this video. 7 00:00:26,860 --> 00:00:29,360 I've just installed this. So it's a clean install. 8 00:00:29,360 --> 00:00:31,860 There are no compiler tools installed. 9 00:00:31,860 --> 00:00:34,860 It's just clean install and update right out of the box. 10 00:00:35,260 --> 00:00:38,760 And as you can see, I'm running this on an oracle VirtualBox. 11 00:00:39,160 --> 00:00:43,360 Okay. So I'm going to close this, just wanted to show you what version I was warning. 12 00:00:43,360 --> 00:00:46,660 And what I want to do first is I want to install the compiler tools. 13 00:00:46,660 --> 00:00:48,660 So I'm going to open up a terminal session. 14 00:00:48,660 --> 00:00:52,160 I'll just right click on the desktop and open terminal. 15 00:00:52,160 --> 00:00:55,660 And I'm going to make this font just a little bit bigger so you can see it a little better. 16 00:00:56,260 --> 00:01:00,920 And that's where we're at now. I'm assuming that if you're running ubuntu, you're pretty familiar with Linux. 17 00:01:00,920 --> 00:01:04,580 So I'm going to use the advanced package tool, APT, 18 00:01:04,879 --> 00:01:06,180 to install this. 19 00:01:06,180 --> 00:01:09,580 The first thing we need to do is we need to type in sudo. 20 00:01:09,940 --> 00:01:11,740 Be very careful 21 00:01:11,740 --> 00:01:15,240 when you're doing these installations. Double check what you're typing. 22 00:01:15,240 --> 00:01:19,040 Remember, when we use sudo, sudo stands for a super user do. 23 00:01:19,480 --> 00:01:22,280 So you are becoming super user, which means 24 00:01:22,280 --> 00:01:24,160 you have access to everything. 25 00:01:24,160 --> 00:01:27,160 So you can do a lot of really good things and you can do a lot of damage 26 00:01:27,160 --> 00:01:30,760 if you're not careful. So be very careful with what you type. 27 00:01:30,760 --> 00:01:34,560 So the first thing I want to do is I want to type sudo APT update. 28 00:01:35,360 --> 00:01:38,160 So that we can update our packages. 29 00:01:38,660 --> 00:01:41,060 It's going to prompt you for your super user password, 30 00:01:42,500 --> 00:01:44,700 which I've just entered. And I'm going to press enter. 31 00:01:44,700 --> 00:01:48,500 And it's going to go through and update your packages. Now you can see 32 00:01:48,500 --> 00:01:50,500 that all my packages are up to date. 33 00:01:50,500 --> 00:01:53,600 Yours might not be in which case maybe you want to upgrade them 34 00:01:53,600 --> 00:01:56,000 with sudo APT upgrade. 35 00:01:56,000 --> 00:01:59,660 If you choose to, you don't have to but might as well keep them updated. 36 00:01:59,660 --> 00:02:02,960 So at this point, we're ready to install 37 00:02:02,960 --> 00:02:04,960 the c++ compiler. 38 00:02:04,960 --> 00:02:07,860 Now I'm going to do this using build essential, 39 00:02:07,860 --> 00:02:11,360 and that includes the compiler, the libraries and make. 40 00:02:11,360 --> 00:02:13,060 And I'm going to clear this. 41 00:02:13,060 --> 00:02:17,660 And you can see first off. If I type g++, g++ is the command 42 00:02:17,660 --> 00:02:19,160 that runs the compiler. 43 00:02:19,160 --> 00:02:20,860 The compiler is not installed yet. 44 00:02:20,860 --> 00:02:24,860 So I'm going to get this little message here that says g++ isn't found, 45 00:02:24,860 --> 00:02:29,220 but you can install it like this. So you could say sudo APT install g++. 46 00:02:29,220 --> 00:02:32,620 And you could do that and then you'd have to install sudo make and so forth. 47 00:02:32,620 --> 00:02:34,840 So I just want to do it all in one shot. 48 00:02:34,840 --> 00:02:38,840 And what I'm going to do is again let me clear this I'm going to type sudo 49 00:02:39,040 --> 00:02:42,240 apt install and then build 50 00:02:42,640 --> 00:02:44,240 -essential. 51 00:02:45,240 --> 00:02:47,740 Okay. So again sudo apt install 52 00:02:47,740 --> 00:02:50,740 build-essential. And when I press enter, 53 00:02:51,400 --> 00:02:54,300 it's going to find those packages. And it says, do you want to continue? 54 00:02:54,300 --> 00:02:57,000 It's going to tell you how much disk space it's going to take and so forth. 55 00:02:57,000 --> 00:02:58,400 So I'm going to say yes. 56 00:03:01,400 --> 00:03:04,600 And there it goes. It's installing this package. 57 00:03:04,600 --> 00:03:07,600 Now this includes the c compiler, the c++ compiler, 58 00:03:07,600 --> 00:03:09,260 the libraries that we need 59 00:03:09,260 --> 00:03:13,590 as well as make which is a tool that's used by code lite behind the scenes. 60 00:03:13,590 --> 00:03:16,590 So it doesn't take too long, maybe a couple of minutes. 61 00:03:16,590 --> 00:03:20,590 You can see it's about 65% done now. And once it's finished, 62 00:03:20,590 --> 00:03:23,390 we'll test it out by typing g++. 63 00:03:23,390 --> 00:03:26,590 And we should get the g++ compiler running. 64 00:03:27,490 --> 00:03:29,090 Okay. So it's almost done. 65 00:03:30,590 --> 00:03:34,790 It's right at 99%. It usually takes a couple of minutes. It didn't take too long. 66 00:03:35,290 --> 00:03:37,890 And that's it. We're done. So I'm going to clear. 67 00:03:38,890 --> 00:03:42,550 And now I'm going to type in g++ 68 00:03:42,550 --> 00:03:46,650 --version, press enter. 69 00:03:47,750 --> 00:03:51,550 We're running g++ version 7.5. We're good to go. 70 00:03:51,550 --> 00:03:55,150 Our c++ compiler is installed and it's ready. 71 00:03:55,150 --> 00:03:58,810 The next step is to install CodeLite, and we're going to do that right now. 72 00:04:01,010 --> 00:04:05,510 Okay. So now that we've got the c++ compiler installed on Linux, we're 73 00:04:06,010 --> 00:04:09,670 we're going to install CodeLite now. So I'm going to move this terminal over here. 74 00:04:10,920 --> 00:04:12,920 And I'm going to open up a browser. 75 00:04:12,920 --> 00:04:14,520 I'm going to open up Firefox in this case. 76 00:04:14,520 --> 00:04:17,120 And I've already gone to codelite.org. 77 00:04:17,120 --> 00:04:22,110 So that's the website we want to go to codelite.org, 78 00:04:22,110 --> 00:04:23,310 you can see right here. 79 00:04:23,310 --> 00:04:26,510 Websites change over time as I've said before, 80 00:04:26,510 --> 00:04:28,510 but we want to look for the download link. 81 00:04:28,510 --> 00:04:30,810 We can see it up here, and we can also see this 82 00:04:30,810 --> 00:04:33,310 big green button right here, which is the one we're going to use. 83 00:04:33,310 --> 00:04:35,670 So what I'm going to do is I'm going to click on that button, 84 00:04:36,770 --> 00:04:41,170 and it takes you to a page here where you can support the developers if you wish 85 00:04:41,170 --> 00:04:44,670 or you could just say not now take me to the download. I'm going to go there, 86 00:04:45,270 --> 00:04:49,570 and I'm going to find in the CodeLite 14.0.0, 87 00:04:49,570 --> 00:04:52,270 and that's the current release as of this video. 88 00:04:52,970 --> 00:04:56,970 I'm going to look for the ubuntu Linux, Debian 89 00:04:56,970 --> 00:04:58,270 releases right here. 90 00:04:58,270 --> 00:05:00,270 And what we're going to do is we're going to click on there. 91 00:05:00,470 --> 00:05:02,770 And what we're going to do is we're just going to follow these steps 92 00:05:02,770 --> 00:05:05,970 verbatim to install. And it's pretty easy to do. 93 00:05:05,970 --> 00:05:08,770 I'm going to clear my terminal over here. 94 00:05:09,320 --> 00:05:13,200 Be very careful again, we're using sudo here. So we want to be sure 95 00:05:13,200 --> 00:05:15,400 that we type these things correctly. 96 00:05:15,400 --> 00:05:19,280 Actually I'm not even going to type them, I'm just going to cut and paste them or copy and paste them. 97 00:05:19,280 --> 00:05:23,280 So the first thing we want to do is we want to come right over here 98 00:05:23,580 --> 00:05:27,240 and add the public key that we need.So I'm just going to copy that 99 00:05:27,540 --> 00:05:29,740 and I'm going to paste it right into the terminal here 100 00:05:31,100 --> 00:05:32,100 and press enter. 101 00:05:32,600 --> 00:05:33,850 It's going to ask you, 102 00:05:33,850 --> 00:05:36,950 well it didn't ask me for the password because I had just used it before. 103 00:05:36,950 --> 00:05:39,450 So we're good here. We've got the key that we need. 104 00:05:39,450 --> 00:05:45,040 Now we need to get the repository that's proper for our release of ubuntu. 105 00:05:45,040 --> 00:05:49,140 I'm running ubuntu 18.04, which is bionic. 106 00:05:49,390 --> 00:05:51,390 So this is the one I want right here. 107 00:05:51,890 --> 00:05:55,450 And what i want to do is I want to copy this line right here. 108 00:05:55,450 --> 00:05:58,850 And I want to replace the EOAN universe 109 00:05:58,850 --> 00:06:00,510 with bionic universe. 110 00:06:00,510 --> 00:06:02,510 Okay so depending on which version -- 111 00:06:02,760 --> 00:06:06,560 which distribution release of Ubuntu you're running, you could use 112 00:06:06,560 --> 00:06:10,550 buster, bionic EOAN and a whole bunch of others down here 113 00:06:10,550 --> 00:06:12,550 for CodeLite 13. 114 00:06:12,550 --> 00:06:15,850 So what I'm going to do is I'm going to copy this guy right here. 115 00:06:18,850 --> 00:06:23,210 And I'm going to change this line right here to bionic universe. 116 00:06:29,090 --> 00:06:30,750 And put the quote mark at the end. 117 00:06:30,750 --> 00:06:34,050 So again, what I'm typing is this line right here 118 00:06:34,050 --> 00:06:36,650 except I'm using bionic in place of you in here. 119 00:06:37,450 --> 00:06:38,810 Okay. So I'm going to press enter, 120 00:06:40,690 --> 00:06:42,690 and it's going to go off and do its thing. 121 00:06:47,090 --> 00:06:50,090 All right. Now I'm just going to say sudo apt. 122 00:06:50,090 --> 00:06:52,190 Yet, you don't have to say apt-get, you could just say apt. 123 00:06:52,190 --> 00:06:55,850 But I would say apt-get because I'm going to follow these directions exactly like they are 124 00:06:55,850 --> 00:06:56,950 I want to update. 125 00:06:59,450 --> 00:07:03,550 Again, let it do its thing. And then finally, this line right here 126 00:07:05,850 --> 00:07:09,840 I'm going to say the last one which is sudo apt-get 127 00:07:10,040 --> 00:07:11,340 install CodeLite. 128 00:07:11,340 --> 00:07:14,220 So again, all I'm doing is following these directions. 129 00:07:14,220 --> 00:07:15,720 So I'm going to press enter here, 130 00:07:17,020 --> 00:07:21,320 and it's going to do its thing and install CodeLite. It's going to say do you want to continue? I'm going to say yes. 131 00:07:23,680 --> 00:07:25,680 And this will take a couple of minutes. 132 00:07:27,180 --> 00:07:30,680 You could see the percentage down here. It's about 20%,21%. 133 00:07:30,680 --> 00:07:33,680 Just let it do its thing don't interrupt it. And when it's done, 134 00:07:33,680 --> 00:07:35,480 we should have CodeLite installed. 135 00:07:40,140 --> 00:07:44,140 And while we're waiting for this CodeLite, as we can see on the webpage 136 00:07:44,140 --> 00:07:46,020 and I've talked about this before, 137 00:07:46,020 --> 00:07:48,020 let me go to the CodeLite webpage again. 138 00:07:49,620 --> 00:07:50,980 Right, here's the main page. 139 00:07:50,980 --> 00:07:55,580 CodeLite is a cross platform IDE that works with c, c++, 140 00:07:55,580 --> 00:07:57,080 PHP and JavaScript. 141 00:07:57,440 --> 00:08:01,100 It's a very small, lightweight, very good complete 142 00:08:01,100 --> 00:08:04,100 IDE and it runs across all of these platforms 143 00:08:04,100 --> 00:08:05,900 which is really nice. 144 00:08:05,900 --> 00:08:08,500 That means that if you learn it on one platform, 145 00:08:08,500 --> 00:08:12,700 you know it on another platform. So it's really easy to switch between windows 146 00:08:12,700 --> 00:08:15,200 and Linux and mac and everything else. 147 00:08:15,600 --> 00:08:18,000 So we're about 62% now. 148 00:08:31,360 --> 00:08:32,659 Okay. So we're done. 149 00:08:33,159 --> 00:08:36,260 It took probably 4 or 5 minutes on my machine. I sped up 150 00:08:36,260 --> 00:08:38,559 the video, so you wouldn't have to wait that whole time. 151 00:08:38,559 --> 00:08:41,059 At this point, CodeLite's installed. 152 00:08:41,059 --> 00:08:45,560 In the next video, we'll configure it so that we can write c++ programs with it. 153 00:08:45,560 --> 00:08:47,060 I'll see you in the next video.