Lesson 0: Downloading & Installing a compiler


Welcome to the very first lesson of 'Let's Program Games'. We're going to cut to the chase & jump straight in. The very first thing we need before we can do create our programs is a compiler. This is just a program that takes out source code (written in our programming language. In our case C++) & converts it into machine code, the bytes that the computer can understand. An analogy of this is with spoken languages. Say the computer only understands a very hard langauge to speak.

It would take a very long time for us to write our program in machine code & we would probably make a lot of mistakes. People still do code in this way & is a handy skill to have, although for this course, we won't be writing any machine code. We'll just be relying on the compiler to do this for us!

There are many different 'brands' of compilers. All doing the same job in slightly different ways. For our course we'll be using a different compiler depending on what OS your using. If your using Mac or Linux, you'll use the GNU compiler, abreviated as gcc (gnu C compiler). This is a very popular compiler that's been around since the 70's. It was originally made for the unix OS, but runs on Mac & Linux. A version even exists on Windows, called MinGW.

If your on windows we'll use a different 'brand' of compiler, Microsoft's compiler. Although there's a version of the GNU compiler on windows, we'll use Microsoft's since it is easier to install.

Mac Version: For mac you can either donwload XCode off the app store, and installing this will automatically install gcc. If you don't want to download XCode or can't (older systems), you can download just the command line tools for XCode. (You'll have to create an Apple Developers account to access this page (which is free!))

Windows Version: For Windows we install Visual Studio. On that page, where there is 'Download Visual Studio', select the Community Edition (this is free). Just follow the install prompts. We don't need anything special, just the default install. And with this you'll get access to the compiler on your computer. There is one more step to run the compiler, but we'll mention this in Lesson 2 of this project.

When installing Visual Studio, make sure Common Tools for Visual C++ is ticked.

Well done! You've completed the first step to getting started coding games. The compiler is going to be our fellow companion on this journey, so you'll get to know it pretty well! But before we can use it we have to write some code. And to do this, we need a text editor.

To Next Lesson