LiquifiedGold's picture

 

(Wellcome to tutorial 2!)

Now that we have all the code writen out, we need to translate it into a language the computer can understand. There are two steps to this.

The first step is called compiling. In this step the computer compiles each sorce code file, or each .CPP file, in your project (more coplex projects have more than one sorce file) and generates an object file (.OBJ) for each one. The object file contains the object code or the machine language.

In the next step, called linking, the linker combines all the object files, as well as any libaray files (.LIB), to produce an executable file (.EXE). It is this file that will run on your platform.

In short, the computer compiles the code then links it to the executable and the executable is what you see running on screen.

Now time to translate!

Go to the top bar and click Debug->Start Without Debugging and...

Bam! Translated! Well that was surprisingly easy.

     Note: If a window pops up saying something like: Are you sure you want to build this?!                      Just click ok. It does this every time you change the code.

When you click debug, the compiling and linking prosess are shown in the output bar.

Like so:

If you have written legal C++ code, it will run fine. However if you have written illigal code the computer will have a hard translating it and a window will pop up telling you there were error(s) in the build. If this happens you want to click no and find out what the error was. Click on the Error List. This list will tell you what you did wrong. If you double click on the errors it will highlight where they are. And if you get 4 errors, don't worry! I got 6 errors just because I put a "j" infront of "std::". 

Before you notice the output box you will notice the program. This is the little black box that appears and asks for your name.

It should look like this:

Hooray! It worked!

        Note: When you chose start without debuging it will atuomatically add the "Press any                          key to continue" functionality.

Before continuing review the code. Try to figure out what each line of code does.

Done?

Allright. On to the next tutorial...

 

ShadowPwn's picture
is impatiently waiting for someone to join his forum...
User offline. Last seen 3 weeks 1 day ago. Offline
Joined: 08/15/2009
Add friend

Yes, very. 

Gaming Mama's picture
is thinking about playing Dawn of Discovery.
User offline. Last seen 19 weeks 1 day ago. Offline
Joined: 08/15/2009
Add friend

 Great job!