Hello everyone.
In this video I'll be installing the C plus plus compiler along with the build tools that we'll need
to build C plus plus programs on Linux distribution that I'm using is Ubuntu 22.04, 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 and so forth.
As I said, I'm on ubuntu, so open up your favorite browser and head over to code light.
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 in a terminal.
Now, I'm done with this for now.
I'm just going to minimize it and 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 this stuff on my system, so we're good.
Let me clear the screen so I can go ahead and I can type in which GCC, which is the compiler we're
going to use for C and you'll see that it has USR bin GCC, that's where it's installed.
You can also type in GCC dash dash version and you'll see that I have 7.5.0.
This may be different for you.
It may be an up to date version.
It really doesn't matter what version it is, it should be good to compile C programs.
So now you know that you have the compiler installed.
All right.
So the next step is to install code lite.
And then once we install code lite, we can configure code lite to work with the compiler we just installed
and we should be good to go.
So head over to code lite org again.
And in the docs 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 do is have access to these and copy and paste them.
Okay.
So let me open the terminal again.
And I'm going to move the terminal just over here 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 unhighlighted 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.
Now, if you got any error here where you weren't able to fetch the certificate, said general error
or something like that, you may have to actually issue the sudo apt, install CA certificates command
and this will install the certificates and then you can execute that command again to fetch.
So you just do APT install certificates and then after that you can do the actual fetch keys and it
should be able to grab them from there.
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 Bullseye 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 and 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, 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.
I'll 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 just change that.
Four to a seven just like that 17.0 star.
And that will install code light 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 code light installed and the
next step is to actually run code light and configure it to work with the compiler.
Okay, so we're done with that.
So let's now open up code light and configure it to work with the compiler.