Lesson 1: Set up a C++ Development Environment

So this is pretty simple.

If you find that you don’t understand some of the terminology in this post, please check out my “Learning to Crawl” post that provides a little background.

Quick Method:

You really just need to download an IDE and it should include pretty much everything you need.

I’m going to be using Visual Studio 2015 or 2017 to do my tutorials because I was provided the full enterprise version of the software for my job.

There are plenty of free C++ IDEs out there such as CodeBlocks, Eclipse for C++, or even Visual Studio Community (free trimmed down version of full IDE).  These also come with compilers to generate your program from the code we write.

These IDEs include a pre-configured editor, a compiler, and a linter all wrapped up into one.

Long Method:

If you want to take the long route, you can get all of these items individually.  This means you need to take the time to get them configured properly to work in unison as desired.

1st hurdle:
Chose an editor.

There are a handful of popular coding editors out there.

These are all free editors and have large communities behind them.

2nd hurdle:
Installing a compiler.

  • GNU G++/GCC
    • GCC used to stand for GNU C Compiler.  Since it now compiles other languages than C, it now stands for GNU Compiler Collection.
  • MinGW-w64
    • Windows based compiler based on GCC.  This is a pretty solid choice as it’s very lightweight.

If you are having troubles getting one of the compilers installed, let me know in the comments and I will work on creating a post outlining the steps for this.

3rd hurdle:
Set up your editor.

When you install a programming text editor like one of the ones above, it’s an a la carte experience.  The editors are usually created to support a ton of different extensions and programming languages, but they don’t usually come pre-configured for anything.  You need to do some research on your particular editor and get it set up for C++ programming.   This is usually fairly simple, just another step in the process.  If you follow the links I posted above for one of the editors, you can poke around on their site to find the message boards where a ton of people have posted useful information in regards to setting up the editors.

4th hurdle:
Compiling code.

Whenever you want to compile your program, you’ll need to run a command line to pass your .cpp files into the compiler to generate your .exe file.

In an IDE, there is usually a button labeled “build” or something similar that will automatically compile your program for you.  The process is a bit trickier when you’re trying to do it manually.

Stepping through this process is a bit outside the scope of this post though.  If you would like me to create a lesson outlining the process of manually compiling outside of an IDE, let me know in the comments section below!

Summary:

There are multiple ways to set up a dev environment for C++ but I would highly suggest you download an IDE when you’re starting out.

This will allow you more time to focus on writing and learning code moreso than setting up your environment.

Good luck out there everyone!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s