(bright music)
(zooming)
(keyboard typing)
Mitropoulos: Now that CodeLite is installed,
we need to run it, configure it,
and then run a little test program
to make sure our configuration is correct.
So the first thing we wanna do is,
we wanna find CodeLite
and you can just type "Code" in the search
and you'll find CodeLite, and double click.
Now the first time it runs,
you may get a small window like this
and it's probably a good idea
just to make it a little larger.
Okay, now, sometimes when you run it the first time,
you'll get a setup wizard that runs, sometimes you don't.
We'd like to run the setup wizard, so if it doesn't show up,
you can go to help, run the setup wizard, and select that.
And you get a window that pops up.
So I'll select next.
Now here, CodeLite supports PHP and Node
and a few other technologies.
We really don't want all that clutter on our IDE.
We wanna strictly concentrate on C plus plus.
So I would suggest that we clear all the plugins
and then turn on only the C plus plus plugins.
So you can see now that not everything is checked,
only the C plus plus plugins are checked
and we'll select next.
Now we'll scan our computer for any installed compilers.
So we'll scan the computer and it's found GCC across GCC.
I'm gonna select GCC.
GCC stands for the GNU Compiler Collection,
which includes CEC plus plus, Fortran 8 and a few others.
I'll select next.
As far as the editor theme,
and this is really a preference for you,
this dark monichi theme is really easy on the eyes
but it doesn't show up too well on video.
So I'm going to select
the classic eclipse look for the videos.
You can choose whatever your preference is.
And I'll press next.
I'll leave these defaults as is and press finish.
Okay. Now, sometimes it opens up two windows
like you see here.
So I wanna save and exit
and I wanna shut down all the versions that I've got going.
I don't know why it does this, but it does it a few times.
And I'll save and exit again.
Alright, so now let's, now we're back to normal.
Let's try that again.
So we'll run CodeLite
and let's make this full screen again. Perfect.
Okay, so now what we need to do is
we need to create a workspace.
A workspace is an area
where we can have our C plus plus projects.
So we can have many C plus plus projects in one workspace.
We can do that by selecting this button here
called new workspace,
or we can go up to file, new,
new workspace either place.
So I'm gonna select this button here.
And it's gonna ask you for the workspace name.
This could be any name you like.
I'm going to say CPP workspace
and I'm going to put this on my desktop.
You can store it anywhere you like
as long as you remember where it's at.
So I'm gonna put this on my desktop.
I want to create the workspace under a separate directory
that'll help me organize my files better,
and press okay.
That's it.
Now we've got a workspace
which you can see here on the left side.
I can right click on that now and create a new project.
Again, I can also go up file, new project.
So I'll do that.
Now we've got some options here as to which template to use
to create the project.
We're gonna stick to the console template,
which is just basically a terminal window.
And we want G plus plus.
That's the C plus plus compiler.
It's called G plus plus
because it's the GNU C plus plus compiler.
I'll select next.
What's my project name?
It could be anything you like.
Don't use spaces for any of these project names.
So I'll just say test one.
And again, I wanna create a project in a separate directory
under the workspace.
So I'll select next.
Now it's gonna ask you which compiler do you want to use.
You may have a lot of different compilers on your system.
Just select the one that you used in the setup wizard
and you'll be fine.
And these defaults are perfectly fine.
We'll select finish.
And that creates a test project under the CPP workspace.
And you can see it's called,
it's created a source directory.
And in there it's got a main CPP file.
That's our C plus plus source code.
And we'll get to that in a second.
We need to do a couple of bits of configuration though
before we we do anything else.
Let's go to our project, test one in this case.
And we'll right click
and we'll go down to the bottom where it says settings
and we'll select that.
And then we'll go to where it says compiler options.
And notice I'm in the global settings,
that's pretty important.
I'm in the global settings, compiler options.
And then I'll select these three little dots here
on the button.
And I wanna make sure that W all is selected,
that way we always get warnings
and I wanna make sure that the C plus plus,
standard C plus plus 14 is selected.
That's the latest standard for C plus plus.
That'll make sure that we're using
the modern C plus plus compiler.
At that point you can click okay, apply.
Okay, good.
Now we can go to our workspace and right click on that,
and come down to workspace settings.
And you'll see environment and code completion.
Go to the code completion
and select enable C plus plus 14 standard.
The code completion is a tool
that the integrated development environment uses
that tries to figure out what I'm typing
and what I want to type.
And it helps predict what I want to do so it can help me
so I don't have to type so much
and it can do some checking as it goes.
In this case, I'm just telling it
to use the modern C plus plus compiler.
I'll select okay.
And that's it.
Now we can run a simple test program.
We'll double click the main CPP file.
And this is actually C code, not C plus plus code.
So we'll delete this in a minute
but that font is a little small.
So in my case, since I'm doing this on video,
I'm gonna go to settings, colors and fonts.
And I'm just gonna set that to about 16.
And let's see.
That's much better.
You should see that much better.
Okay, so let's delete all of this
and we'll write a really simple C plus plus program
as we go through the course.
I'll talk about the anatomy of a C plus plus program
and we'll go into detail
as to what everything I'm gonna be typing here means.
But for now, just type along
and let's get a clean run
so that we know our environments are set up.
So the first thing we wanna write is,
we wanna write pound include
and IO stream inside angle brackets.
Then we'll press enter.
Then we'll say INT, main and open and close parens.
Then we'll create,
then we'll type a left curly
and the integrated development environment
will automatically close that for me.
And here all I wanna do is say STD, two colons, and C out.
Then the insertion operator, which is two less than signs
with no space in between
and just some string saying "Hello testing"
or anything else you like.
That has to be in double quotes.
And then finally we'll put a semicolon on the end of that
to terminate.
And then finally, the last statement will be return zero.
That means that the program terminated correctly.
That's it.
That's our first really simple C plus plus program.
And like I said in the beginning of the course,
I'll go through what all of this means
and we'll go through the anatomy of a C plus plus program
in great detail.
I'll save this.
Another option you may like is,
if you come up here to the menu and you say view
and it'll say toggle minimal view.
And you can see it's putting a bunch of buttons up here.
If you like this, this is great.
Because you know you can run and compile
and do all kinds of things just by clicking on a button.
I'm not gonna use that
because I find that's pretty distracting to the video.
So what I'm going to do is
I'm just gonna shut that off on my end,
but feel free to use it.
I'm gonna use command keys
and I'll also just come up here and say, you know, build.
And that way it's very explicit what I'm doing
rather than just clicking on a button.
So that's it.
So let's run this.
Now what what I'll do is I'll say build.
First thing I want to do is I want to clean this project.
That way there's no remnants of anything left over.
It'll put it into a stable state.
That's good to go.
So I'll clean the project,
all the, any messages will show up down here.
Then I'll say build, and I'll just say run.
And it's going to ask me
do I just wanna run it or do I wanna build it and run it?
Well, in this case, I have to build it and run it
because I haven't built it yet.
So I'll select build and execute.
And if all goes well, we'll get a window that pops up
that says "Hello, testing" exactly what we typed here.
Press any key to continue, oh sorry
press enter to continue, which I'm going to press now.
The window goes away and we're done.
Now several things could go wrong here.
You may have an error in your program.
You might have forgotten to type this exactly right.
So you may have forgotten the semicolon.
In which case when you go to build and run,
you will see this red line here.
That's a compiler error.
You'll also see a red arrow over here
telling you there's something wrong here.
And the compiler's telling you,
it's expecting a semicolon before the return.
So put it in there.
Just be really careful.
I'll talk about debugging and fixing syntax errors
throughout the entire course.
But at this point, save it, make sure it's right.
Again, be very careful.
You may have extra quote marks
and the compiler won't like it.
You might only have a single less than sign here
and it's not gonna like it.
So it's just be sure it's exactly like this.
Once you've got it set up, build, run, build and execute.
There's a clean run and there's my terminal.
Okay, so that's it.
We're all set to learn C plus plus.