Now that code light 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 want to do is we want to find code light and you can just type code in the search
and you'll find code light and double click.
Now the first time it runs, you make it a small window like this and it's probably a good idea just
to make it a little larger.
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, code light supports PHP and Node and a few other technologies.
We really don't want all that clutter on our IDE.
We want to strictly concentrate on C++.
So I would suggest that we clear all the plug ins and then turn on only the C++ plug ins.
So you can see now that not everything is checked, only the C++ plug ins 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 and cross GCC.
I'm going to select GCC.
JC stands for the new compiler collection, which includes C, C++, Fortran, Ada and a few others
I'll select next.
As far as the editor theme, this is really a preference for you.
This Dark Monaco 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.
Now press next.
I'll leave these defaults as is and press finish.
Now sometimes it opens up to windows like you see here.
So I want to save an exit and I want to 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 an exit again.
All right, so now let's now we're back to normal.
Let's try that again.
So we'll run code light
and let's make this full screen again.
Perfect.
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++ projects, so we can have many C++ 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 going to select this button here and it's going to ask you for the workspace name.
This can be any name you like.
I'm going to say C.P 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 going to 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 going to 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 new C++ 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 want to create a project in a separate directory under the workspace, so I'll select
next.
Now it's going to 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 CP workspace and you can see it's called
it's created a source directory and in there it's got a main CP file that's our C++ source code and
we'll get to that in a second.
We need to do a couple of bits of configuration though before 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 mean, the global settings, that's pretty important.
I mean the global settings compiler options and then I'll select these three little dots here on the
button and I want to make sure that w all is selected.
That way we always get warning.
And I want to make sure that the C++ standard, C++ 14 is selected.
That's the latest standard for C++ that will make sure that we're using the modern C++ compiler.
At that point, you can click 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++ 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 you to use the modern C++ 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++ 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 going to go to settings, colors and fonts, and
I'm just going to set that to about 16.
And let's see,
that's much better.
You should see that much better.
So let's delete all of this and we'll write a really simple C++ program as we go through the course.
I'll talk about the anatomy of a C++ program and we'll go into detail as to what everything I'm going
to 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 want to write is we want to write, pound, include and IO stream inside angle
brackets, then we'll press enter, then we'll say int main and open and closed parens, then we'll
create, then we'll type left curly and the integrated development environment will automatically close
that for me.
And here all I want to do is say STD to colons and see out then the insertion operator, which is two
less than sines with no space in between and just some strings 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 returned zero.
That means that the program terminated correctly.
That's it.
That's our first really simple C++ 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++ 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 will 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 can run and compile and do all kinds of things just by
clicking on a button.
I'm not going to use that because I find that it's pretty distracting to the video.
So what I'm going to do is I'm just going to shut that off on my end, but feel free to use it.
I'm going to use command keys and I'll also just come up here and say, 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 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.
Now I'll just say run.
And it's going to ask me, do I just want to run it or do I want to 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'll 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 is 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 going to like it.
So 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.
So that's it.
We're all set to learn C++.