OK.
So welcome back.
In this video lecture, we will be going over how to set up a project in Sea Lion so we can do the same
Hello World program.
And I'll be showing you how to compile and run that from sea lions.
So this is for people who have decided to download and use Sea Lion for the course, whether that be
in addition to Visual Studio and or terminal.
If you would like to use Sea Lion to write code, then I think it would be a good idea for you to watch
this entire video to see how you can set up a project and get it running.
I will also go over some of the basics of Sea Lion.
Of course not covering everything because it is a very complex development environment with a lot of
buttons and things and tools.
But I'll be going over how to just write basic code, compile it and run it.
All right.
So with that, let's go ahead and open sea lion.
So go to wherever your sea lion is and go ahead and click on it or double click on it, or just search
it in here and click on it, whatever you need to do.
So I'm going to open up sea lion.
All right.
So I already kind of made this hello world thing, but what I'm going to do is actually click new project.
And what I want right now is a C++ executable later on, we might be new in C++ libraries and things
like that.
You can also have C programming language executables and libraries.
See, I haven't talked about that at all, but it basically was a predecessor of C++, very similar
to C++, but much less capability as far as, you know, modern programming and stuff like that.
Still a great language still used, but not going to be talking a ton about it, maybe a little bit
in the course embedded.
And then you also even have like some web stuff here.
So pretty cool.
You noticed the sea lion has a lot of stuff.
Just front end JavaScript library react.
So it's pretty, pretty powerful already.
You can see there's a lot going on here with Sea Lion.
So I'm not going to call this untitled.
I'm going to go over here and just call this hello world.
I, Stuart, hello, underscore the score world, and then you can just click Create.
We're going to use the C++ 14.
You can go in here and use newer or earlier versions of C++, if you would like.
I'm just going to stick with 14, though.
All right, so let's check out what it brought up, so this is pretty funny, right?
We didn't even need to type anything, and this is not related to the fact that I call it Hello World.
I could call the file anything, and it's going to just make a hello world program for me, and it's
already going to make a file for me called me and.
So it's not.
It's just like a coincidence.
You know that I call the Hello World, and it also made a hell a whole program.
So something I should say right now is that if you have not watched the Hello World video where I did
it in voice code, go ahead and watch that because it's not only about voice code, it is about Hello
World, and I talk a lot about the Hello World program.
I do not go into great detail about each of these things, but I kind of say it in layman's terms and
then tell you, Hey, look, there's a lot of code that just got dumped on us, but this is the minimum
thing we need to do to make a program that kind of does something interesting at all in C++.
So I'm not going to be going over this program today.
This is just a video about sea lions.
So if you haven't watched that video where it's about Hello World, but I do use Visual Visual Studio
code, please go watch that.
VIDEO So it wrote this whole program for us, which is pretty funny, but it just does this every time
you make a new project.
And then from here you can change things and add things if you want.
One thing we did talk about in that previous video was that the main is a special function.
This name right here for this function is special.
It's kind of like the entry point to our program.
So that's why it puts it here.
It actually makes a file for you called ManeD CP.
Hello World is actually the project folder.
So we chose to call our project Hello World, and it made a folder inside of this location.
You know, this personal projects thing I have here, so wherever you wanted to put that, you can make
a directory or a folder and name it.
And then inside of here, it made this main cup for you.
So this is the C++.
That we're going to compile into an executable, so we chose C++ executable as our project and it Seelye
and said, OK, I'm going to make a directory called Hello World because that's what you wanted to name
your project inside of there.
I'm going to put a bunch of files and I'm going to put this main zip file.
So what are these other bunch of files?
These are things that you should not touch right now.
OK, so do not touch anything in here, do not modify these.
This is how Sea Lion is going to compile our program, so we are not we don't necessarily have to invoke
them in GW compiler ourselves with that G Plus Plus command, although we can from Sea Lion and I will
show you how to do that.
But it is actually going to compile this for us, and it's actually referring to the compilation process
as building.
It's kind of a more broad term.
What it does is it has some special files in here.
Kind of most importantly, is this make file.
And when it makes something, it builds it, which is like the compilation process.
It takes it from our code and puts it into a form that the computer can understand that can be ran on
the computer.
So the way that we build it is to use this little hammer right here.
If you just want to compile slash, build your code, then you would click this little hammer right
here to run it.
You click this play button right here says Run Hello World, except that it's not only running it,
you don't have to click the hammer if you don't want to.
You can just click this play button and it will build, slash, compile the program and then run it
for you all in one.
So this is if you just want to build it.
This is to build it and run it all in one.
And then this little bug right here is to debug, but we are not talking about debugging yet, that
is something that we would talk about later in the course.
Debugging is just when you are basically trying to solve some errors that you've noticed in your program.
So if you have errors, an easy way to figure out how to fix those errors is to debug it.
And Sea Lion has a tool called a debugger that helps you do that.
So that's what this button is.
If you want to debug, we'll get into that later.
So just to kind of reiterate these files here, this see make list that Ti has stuff in it that helps
Sea Lion compile your code, your C++ code, like in here, you know it'll have some executable and
like the main zip file that we write in our code in.
But this is stuff that you should not pay much too much attention to.
Now we might modify it later, but right now we're not going to look at it and definitely do not try
and modify these files right now.
Inside of this, see, make, build, debug directory, just kind of leave those alone.
This is where we're writing our code, it is in the file that has the CBP extension.
And if we wanted to, we could make a lot more files in here that were not CPB files or other extensions.
Like I mentioned, C++ has some other file extensions that we will be looking at in the near future.
So with that already done for us, let's just go ahead and build and run our programs so I can just
come over here and click this play.
And there we go, it prints Hello World to the console, except this time unlike in vs code.
It is just printing it to an area right here.
This is not a terminal like in vs code.
In the code, we had a similar little box down at the bottom here, remember, except it was an instance
of PowerShell, which was like a terminal or a command line.
Kind of like this.
The command prompt, except it was using PowerShell.
And we were able to compile it in there ourselves with G Plus Plus and then run it.
Instead, sea lion is just putting the output right here in vs code, we we compiled it and ran it in
that terminal, and then we saw a similar line print out right in the terminal that said, Hello world
here, it's just printing out to this box.
This is not a terminal right now.
Except if I wanted a terminal, I could have a terminal you see down here.
It says Terminal.
So I can actually go to this terminal and what I can do is actually navigate to the executable file
that was created from the compilation process of this Code C line, compile this and made an executable
and it ran it automatically for us.
The executable is inside of here.
Hello, world dot e e the dot Ekeus stands for executable like we were kind of talking about before,
so I said not to touch any of these other files in here, but we can run this executable from this terminal
if we would like.
So since we're not in PowerShell or bash, uh, if you are in bash in here, like let's say you're running
this on like.
Linux, or if you have a terminal that is similar like on Mac in here and Sea Lion, then you can just
do less, but it's not going to recognize that command here since we're just in the normal Windows Command
prompt like similar to this.
So I'm going to have to do dir instead of else.
It's pretty much the same command.
And then I see all this stuff in here.
I see CMake build debug.
I see, you know, see make list text t.
So see, build, debug.
That's where this file is.
Notice that this is this folder here.
See Makbul debug inside of it is all this stuff.
So this executable lies inside this CMake build debug.
So what I'm going to do is I'm going to change directory with that CD command and I'm going to go into
C make build debug.
So now I change directory into C, make Bill, debug the code command I can do dir and you notice now
what I do there, and it lists all of the stuff inside of it.
I see this hello world right here.
So similar to what we did in the video with the code when we were navigating around into the directory
and then we ran it.
We can now run this file from here so I can do a dot and then a slash and then Hello world, and I'm
not going to do CVP.
I'm going to do XY.
And I press enter and there we go.
It's similar to kind of what we saw in vs code now we have a terminal down here where a command prompt
we ran our executable and it printed it here.
To the console in the terminal.
So another thing that we could do is we could compile it on our own, actually, if we wanted to.
So we would be able to go back.
So it's already been compiled and it created this executable, but I can actually go back to where I
was and to do that, I don't know if I've introduced this command yet.
But rather than changing directory into a folder that is inside of where we are, we can go backwards
by doing CD Dot Dot.
The first dot is standing for the current directory, right?
That's what we used right here.
Kind of.
This is this dot slash is kind of to run this, but the Dot signifies current directory.
If I do it again, it basically tells me to go backwards.
So now you notice that I'm not in make bill debug.
I mean, I went one step backwards to here now to Hello World.
So now I'm at this level, I was in this level.
So this was everything in this dropdown was where I was now.
I close this, now I'm in this level.
All right.
I'm in the Hello World directory, so I have access to all this stuff.
So may not CP is in here, right?
So if we if I want to, I could now use that G Plus Plus command that we've used before to compile it
in here.
So I could do G Plus Plus and mean CP.
And so think to yourself, try and remember what is going to happen after I run this.
What will the name of the executable be?
Do you remember what the default name is?
If I just compile a program and I don't do that thing that we mentioned with the Dash?
Oh, to name the output file.
So let's go ahead and run this, and since we're not in PowerShell or bash instead of else, we're going
to do, do you notice now we get in a.
So remember that is the default naming convention for it.
It's going to call it a taxi or a port, something else, depending on the operating system you're on.
So it might be like A. out or something like that.
So now we can go ahead and run that ad XY because it's just like that.
Hello, world.
So let's go ahead and run that.
I'm going to do dot slash x XY and we notice it's the same thing.
It prints out Hello world for us.
So I can also invoke Bash from here, so it would be similar to like Linux.
I told you kind of earlier I mentioned that I have something called WCL, which is Windows Subsystem
for Linux.
If you really would like to put that, get that running on Windows, you can go online and kind of follow
tutorials.
It's kind of in-depth.
I'm not going to add that because I don't have time to add so many things to this course.
One is focused on programming, but you can go ahead and look that up and follow that process if you
would like to have a kind of instance of Linux running on your computer.
And so when I type bash, it puts me into this bash shell here, similar to how I could do in my normal
command prompt like this.
So from here, I can actually, you know, do else instead of there, and I'm actually going to remove
that ACORN XY file now because I don't want that there anymore.
So now I'm going to go back to the normal console, which is this run right here.
This is where I said, Hello, world.
You know, of course, I can build it and run it again.
It'll say the same thing, similar to inverse code that we code tutorial with the Hello World tutorial
that that that was based on the Hello World tutorial.
I could change this text just like I did in that video and just say, you know, Hello, Dylan, and
I can run this again.
And now it says hello, Dylan.
Instead.
OK, so that is the end of this video.
I just wanted to kind of point out how to do this and sea lion in the next video, I will be going over
how to open them in the terminal and then compile it there.
It will probably be quite familiar because we're just going to be using that G Plus Plus command terminal,
but I'm going to also try and do it on Mac.
So I can kind of show you Mac users really like what it's going to be like when you're compiling on
there and also explain about the compiler for Mac because.
It comes with the Clang compiler, I believe, so we don't need to install it like we do with many GW.
All right, so that's pretty much it.
One last thing is if you're worried about whether it's saved or not, auto saves, I believe quite often,
but you can go to file save all and that will save everything here.
So that is the end of this video, and I will see you in the next lecture.