Hello everyone. In this video, I'll be installing the C++ compiler,
along with the build tools that we'll need to build C++ programs
on Linux.
The distribution that I'm using is Ubuntu 2204, which is Jammy.
There are a lot of different Linux distributions out there,
so depending on which one you're on,
you can check out the different options here for Ubuntu, Fedora, so forth.
As I said, I'm on Ubuntu,
so open up your favorite browser and head over to Codelite.org.
And then once you get there, select Docs
and getting started.
And then right where it says prepare your environment, select Linux.
And there's basically one command we're going to run, which is pretty straightforward.
Once you get to the Linux section, there's a lot of information here, right?
Depending on whether you want to install Rust and
Python and Brew and so forth.
I'm not going to do any of that, I'm just going to install the essentials,
which gives us everything we need.
And you can see this box right here that says Install the essentials.
So what you can do is
Hover over this box and click that little icon right
there that's going to copy this information to the clipboard,
and that's what we're going to execute on a terminal now.
I'm done with this for now, I'm just going to minimize it.
I'm going to open up a terminal.
All right, so there's my terminal.
Now at this point, all I really want to do is,
paste what I just copied into the terminal and execute it,
It's as simple as that.
So I'm going to right click right here, paste,
click the right arrow key and press enter.
It's going to ask you for your password.
And that's it,
some of these tools might already be installed depending on the
type of distribution you installed originally.
So it says, do you want to continue?
Yes, I do want to continue.
And there it goes, It's going to do its thing
when it's finished and again,
how long it takes really depends on what's already on your system.
So it may take a little bit longer,
I've already got most of the stuff on my system, so we're good, let me clear the screen.
So if you type g++ -- version, you should get some information
about your compiler.
This is g++, which is the GNU C++ compiler.
And the installed version is 11.3.
The version you have installed might be different, might be 11.4,
12.0, 10. whatever it is, that's fine.
They're all going to support C++ 17, unless you've got a really
old distribution, which is very unlikely.
All right, so the next step is to install CodeLite.
And then once we install CodeLite, we can configure CodeLite to work
with the compiler,
we just installed and we should be good to go.
So head over to CodeLite.org again
and in the Doc section,
you'll see this downloads link right here.
So I'm going to select that and I'm going to click latest.
I've got the information here, how to install for Mac, Windows, Linux.
And this is the one we're interested in right here, the Ubuntu area.
Now, it's all going to be terminal driven, so
I'm going to make some room here for my terminal.
And really what I want to have access to these collect and copy and paste them, okay?
So, let me open the terminal again.
And I'm going to move the terminal just over here
just, so we can get it just slightly out of the way.
Perfect, all right?
So what we're going to do is?
We're just going to go through this
and basically copy these commands into the terminal and execute them.
So the first thing we need to do is?
We need to set the public key,
so again I'm going to click on this little
icon right here, then come over to my terminal.Paste,
press the right arrow just to make sure that that's un-highlighted
and press enter.
It's going to ask you for your password again.
Notice the warning that it's deprecated, don't worry about it,
that's a normal warning.
All right, we're done with that, then I'm going to come down here.
And depending on which distribution you have and again,
there's a lot of Linux distributions out there.
I'm using Jammy,
which is 22.04, If you're using these other releases,
you can use these lines here.
So basically what I'm doing is?
I'm going to execute this command because it's already my jammy command right here.
But if you've got one of these,
you can just replace this part
with whatever distribution you have,
whether it's bulls eye or kinetic or whatever else you have.
So, I'm just going to copy this.
If you're a Linux user,
you probably know exactly what you're doing.
So, let me right click on here and paste it.
Press the right arrow again and press enter.
And it'll just be a second.
Okay, I'm done, I'm going to clear this terminal just to make a little room here.
All right, so I'm going to scroll up here and just a couple of more commands to run.
I'm just going to type these in, the first one is sudo apt update.
sudo apt update.
Press enter.
Okay, that's done, I'll clear it once more.
Okay, so now what we want to do is
We want to install the latest version, which we know is 17.
Don't do this right here for now, just come right down here and type
this one right here.
Just click the icon and paste it just to make it easier.
Okay, clear it once more.
And now here we're going to execute this command,
except we're going to use the 17, instead of the 14.
Because we know that that's the latest.
So, let me paste that.
And I'm going to change that 4 to at 7, just like that 17.0 star.
And that will install CodeLite and all the other dependencies that it might have.
So this one might take a little while, but once we're done,
we've got CodeLite installed
and the next step is to actually run CodeLite and configure it to work with the compiler.
Okay, so we're done with that, so let's now
open up CodeLite and configure it to work with the compiler.