Hello, everyone, and welcome back.
In this video, I'm going to show you how to use the source code files
that are provided for you.
What I've done is I've provided source code for all the examples
and challenges in this course.
And they're all located in the last section of the course.
So if you scroll down to your course content,
you'll see in the last section and I said the last section
that's where it's at now but the course could evolve over time.
But you need to search for something that says source code,
it'll typically be in the last section of the course.
So you can see here section 21 as of this recording
has extra information source code and other stuff.
So right here you can see the source code for all the sections.
I've clicked on that. And this is what you're going to see.
Now these are links to the workspace files, and they've been zipped up or
compressed.
And what you can do is you can click on them and download them and then extract them
and use them within CodeLight on your end.
So I'm going to show you how to do that.
So suppose that I'm on section 4 and I want to download the section 4 source code.
You can come over here to the source code for all sections,
then you can click right on here on source code section 4 getting started.
And I'm going to do that now, and that will download a zip file.
And you can see the zip file being downloaded right over here,
and it's going to be downloaded to my downloads directory.
So I'm going to close up my browser for a moment.
And here I'm in CodeLight.
What I want to do now is at first I want to extract
what I just downloaded or unzip it
so that I can have access to those files and then I want to open it up in CodeLite.
So let's do that. I'm going to go to my downloads,
and there's the zip file that I just downloaded.
Now I'm doing this on windows. The process is exactly the same on mac or Linux.
So there's my section 4.
This is a compressed file, the zip file. So I need to extract it
so I can right click on it
and extract all.
Now you can see the name that Udemy puts on this,
section 4 getting started source code and all that. That's really long. We don't really need all that
because the section names are already in the zip files.
So we could just put it wherever we want. So I'm going to remove that,
and I'm just going to leave downloads, just like it is like that.
Okay. So I'm going to click extract,
and that's going to extract the section 4,
create a sections 4 folder you can see it right here.
And if I double click that, there you go.
Each one of these folders is a project
and this section4.workspace file that's the one that we need
to open in CodeLite. So I'm going to do that now. I'm going to close this up,
and I'm going to go to CodeLight and open a workspace.
If you already have a workspace open,
you need to close the workspace. You can come up here to workspace
and close workspace. You can't open a workspace if there's already one open.
So make sure you close it. Okay. So I'm going to open a workspace,
and I'm going to navigate over to downloads
to section 4, right here the one I just unzipped and
select section4.workspace right here.
Now when I select open, you'll see the workspace and all of its projects
show up over here on the left side here on the workspace view. So I'm going to do that right now
and there we go, we're done.
There's section 4 workspace and these are all the projects
within that workspace. Notice that first program
is bold and italicized that means that that's the active project,
that's the one that will be built and run by default.
Okay. So let's look at the source code for that first project.
I'm going to look for my main.cpp file. I'm going to double click it,
and there's the source code. So now I just want to be able to run this.
So I'm going to come up to build and I can select
build and run project. I would really encourage you to rebuild
the project anytime you download any kind of project
from a website or from the internet in this case.
It's a good idea to rebuild it. So I'm going to rebuild the project,
and you can see down here. I got zero error, zero warning. So we've got a clean build.
It's possible that at this point when you build your project,
a little window will pop up and say what compiler do you want to use?
This is going to be true in Linux and mac for sure.
In that case, pick the GCC compiler that's the one you're using.
So if you get that pop-up, you pick the compiler you want, and you're good to go.
Now that we've built this, we can run it. So I'm going to select run.
I'll execute or I could build and execute again. It doesn't really matter.
And there you go, enter your favorite number between 100,
I'll enter 40, press enter, amazing. That's my favorite number too.
Press any key to continue. Our program ran correctly,
and this is the process that you'll use for all of the sections.
So that's it. Pretty straightforward.
That's the process that you'll use to be able to access
the source code that's in the courses.