Search

0.5 — Installing an Integrated Development Environment (IDE)

As mentioned in the previous section, an Integrated Development Environment (IDE) contains all of the things you need to develop, compile, link, and debug your programs. So let’s install one.

The obvious question is, “which one?”. Keep in mind that you can install multiple IDEs, so there is no “wrong decision” here. During the course of these tutorials, we will be showing you some of the nice features of your IDE, such as how to do integrated debugging. All of our examples will be done using both Microsoft’s Visual C++ (for Windows), and Code::Blocks (for Linux or Windows). Thus we highly recommend you pick one of these.

However, if you would like to try a different IDE, you are free to do so. The concepts we show you will work for any IDE -- however, different IDE’s use different keymappings and different setups, and you may have to do a bit of searching to find the equivalent of what we show you.

Windows IDEs

If you are developing on a Windows machine (as most of you are), then you have two choices:

1) If disk space and/or download size are not a constraint, then we recommend Visual Studio Community 2017. When you run the installer, you’ll eventually come to a screen that asks you what workload you’d like to install. Choose “Desktop development with C++”.

The default options selected on the right side of the screen should be fine, but please ensure that the Windows 10 SDK is selected. The Windows 10 SDK can be used on older versions of Windows, so don’t worry if you’re still running Windows 7 or 8.

This will take about 6.3 gigs of drive space.

2) If disk space and/or download size are a challenge, then we recommend Microsoft’s free Visual Studio Express 2015 for Windows Desktop, which you can find towards the bottom of the page.

The installer that you download off of Microsoft’s web page is actually a downloader. When you run it, it will download the actual IDE from Microsoft and install it.

Note: This tutorial was originally written when Microsoft was distributing the 2005 version of Visual C++. Consequently, some references and screenshots are targeted to that version. Running any later versions (such as 2013, 2015, 2017, etc…) are fine, however, your screens may look slightly different.

Linux or Windows IDEs

If you are developing on Linux (or you are developing on Windows but want to write programs that you can easily port to Linux), we recommend Code::Blocks. Code::Blocks is a free, open source, cross-platform IDE that will run on both Linux and Windows.

Windows users: make sure to get the version with MinGW bundled.

With Code::Blocks, C++11/C++14 functionality may be disabled by default. You’ll definitely want to check and turn it on. First, go to Settings->Compiler:

Then check the box marked “Have g++ follow the C++11 ISO C++ language standard [-std=c++11]:

Note: If “Have g++ follow the C++14 ISO C++ language standard [-std=c++14]” exists for your version of Code::Blocks, use that instead.

After installing Code::Blocks, some users have been getting an error message “Can’t find compiler executable in your configured search paths for GNU GCC Compiler”. If you run into this, try the following:

  1. In you’re on Windows, make sure you’ve downloaded the version of Code::Blocks WITH MinGW. It’s the one with “mingw” in the name.
  2. Try doing a full uninstall, then reinstall.
  3. Try going to settings, compiler, and choose “reset to defaults”.
  4. Try a different compiler.

Alternately, some people prefer to use Bloodshed’s Dev-C++, which also runs on both Windows and Linux.

Mac OSX IDEs

Mac users can use Xcode if it is available to you, or Eclipse. Eclipse is not set up to use C++ by default, and you will need to install the optional C++ components.

Can I use a web-based compiler?

Yes, for some things. While your IDE is downloading (or if you’re not sure you want to commit to installing one yet), you can continue this tutorial using a web-based compiler, such as the one at TutorialsPoint.

Web-based compilers are fine for dabbling and simple exercises. However, they are generally quite limited in functionality -- many won’t allow you to save projects, create executables, or effectively debug your programs. You’ll want to migrate to a full IDE when you can.

Moving on

Once your IDE is installed (which is one of the hardest things this tutorial will ask you to do), or if you’re temporarily proceeding with a web-based compiler, you are ready to write your first program!

0.6 -- Compiling your first program
Index
0.4 -- Introduction to development

389 comments to 0.5 — Installing an Integrated Development Environment (IDE)

  • Ethanicus

    So far so good! Downloading C++ 2010 right now.

    • Alexandra

      Hello,
      I have a question for you. When you instaled it (C++ 2010_, have you seen the box for Microsoft MSDN? I am asking because I didn`t, and I would to know if this is something normal or not. Thank you.

  • jacwib

    This was the easiest step. Seriusly, i just did

    . That was easy.

  • cheapy

    The Orwell Dev-C++ IDE (took over the Bloodshed one) works and is available for free at

    http://sourceforge.net/projects/orwelldevcpp/?source=dlp

    I would suggest trying that rather than other ones where the syntax isn’t exactly correct especially if you are a beginner.

    • cheapy

      Actually, the instructions are clearer for code::blocks and all you need to do to install it is follow the link, go to downloads and select the one for your system.

  • shiki

    hello guys , this is a very noob question ,i know , but i just started here yesterday and i find this incredibly helpful but i encounter a problem when downloading visual c ++ express edition compiler . when i go to the site it says microsoft visual studio . is that the same thing . i d really like to be sure XD .

  • Krazh

    Starting using this site yesterday and so far I love it! Great job!

    I was just wondering how you actually end up with a program that you can run in windows? I’m using Visual Studio Express 2012.
    When I was working on my MacBook it wasn’t a problem as I could simply type ‘make’ in the terminal 🙂

  • mona

    Will Visual C++ 2010 Express Edition be ok to install as i am a complete beginner and have windows vista? or should i install the recommended 2008 version? i’m wondering if it will run on vista since a commenter complained that it didn’t.

    btw, this is an amazing free resource. you have my eternal gratitude.

  • Mena

    Um…so I installed MS Visual Basic 2003. is that okay?

  • Hello, for slackware users, i currently use slackware 13, you may install Code::Blocks from here http://slackbuilds.org/repository/13.0/development/codeblocks/ and dependences from slackbuilds.org too. Geany (Recommended) is simple but fast for short examples, you can download from slackbuilds.org. I dont recommend Bloodshed DEV-c++ for windows is too old instead you can use wxDev-C++ download here http://wxdsgn.sourceforge.net. Bye

  • fero45

    For the very beginning, to test simple code, I would also recommend Geany editor. It runs under Win and Linux. It’s got an in-built terminal. I use it for scripting and testing my scripts in PHP and Perl under Linux.

    Write some code, hit F8 (compile) then F9 (build) and then F5 (execute). In two seconds you can see your output in the terminal. Change your code and hit the function keys again. In a minute you can test your code a couple of times.

    Linux users have to install g++

    Of course, install Code::Blocks under Linux too 🙂

  • Dicennian

    Nice that these things are free. Probably the first tutorial I will ever follow where it feels like if I have the same program xD

  • Space_Knite2

    I Like these tutorials, usually i end up sitting at my computer, staring at huge (and i mean HUGE!) mindless scripts and texts which never really work

    at least this tells you what you need to do accurately, rather than placing you in the middle of something completely alien to you.
    And in answer to your question Noha, the writer of this stated the only difference is the window organisation (the screen of the program is arranged differently)

  • Monco

    I prefer Microsoft Visual Studio 6.0 IDE.
    i’m using Visual Studio 6.0 and I never had problems so far. It’s very comfortable and reliable. Works with Windows 95/98/2000/Me/XP.

    • I used Visual Studio 6.0 for a long time. Was a good product. The downsides of it are:
      1) It’s not free
      2) It only has a partial template implementation, so a lot of modern template code doesn’t work on it.

  • ANshul

    hi i am downloading the 2008 microsoft version of c++ express its 96 mb is it the right thing ?and do i require some sql thing

  • I liked Michael’s comment about bloodshed DEV-c++. Every computer on my school campus has Bloodshed DEV-c++ installed on it. It seems to be very popular for both Windows and Linix (I think it can even be used on Macs but I am not sure). It looks like it is the new hit program to work with C++

  • Rudy

    Alex, I have used this site for a few months now (great tutorial!) and have just now registered to ask this. I can’t seem to find anything on how to turn on line numbering. Every example you have has numbers in it and it would be helpful for me to start using it. I’ve looked everywhere though! I am using the suggested Microsoft Visual C++ 2008 Express. This seemed like the best place to post this so I hope you will find it and help me out. Thanks!

    • Sorry it took me so long to respond. The line numbering is done on this website by a special plugin. I think you can get line numbers in MS C++ 2005 by going to Tools->Options, open Text Editor, select “All languages”, and check the line numbers checkbox.

      Not sure whether it was moved in C++ 2008 or not.

      • ntt

        The line numbering is turned on exactly the same way in the 2008 version.

        Thanks for a great tutorial. At last, a tutorial that treats you like a beginner not an idiot.

  • Pieter

    Damn, will have to wait to get home before i can get the IDE, can’t use up all the companies cap 🙂

  • Does anyone know why Code::Blocks is giving this error message?

  • Stefan

    > So is Eclipse ok?
    sure is ok, it’s quite professional, but is way too slow comparing to dev++ or code::blocks, but if that doesn’t mind you feel free to try NetBeans is way friendlyer in C++ comparing to eclipse.

  • thanks Alex for this great tutorial .
    i was learning JavaScript and i found c++ interesting subject.
    i hope your tutorial will help enough. thanks for sharing

  • Michael

    when i downloaded the Microsoft download thing it was ok but i opened it it kept saying lost connection to the server so i got bloodshed DEV-c++ instead i was wondering if this was the best choice besides Code::Blocks.

  • Dylan

    Whew! It took about an hour but I finally downloaded Xcode. I can’t wait to make my first program!

  • Another great section of the tutorial. Thanks for the feedback on which IDE is most helpful.

  • John

    Great job, I love the site so far. I’m hoping the next tutorials will be as easy to understand as these.

  • Masss

    Wow, this site is so amazing thus far, and I’m sure will continue to amaze me! I just had a question!

    In this tutorial, you suggest the download of Microsoft’s Visual C++ 2005 Express Edition for the window users, but what about this new 2008 version? Would it all work out the same way?

    Thank you for putting this site up.

  • I installed Microsoft Visual Studio Express 2008 and have tried the hello world program in this tutorial, but it dosent work, it says the system cannot find the path specified, (when i try to run it with ctrl f 5) also before that when i click on build solution it says the file is out of date, it also says that when i try to write “game” in the microsoft tutorial. Do you have any suggestions? Thanks!

    • I am not sure what would cause this. Sounds like some of your paths are set incorrectly. Does it compile and not execute? Or does it not even compile?

  • If anybody reading this is a linux newb like me using mandriva. You can just

    as root and then run it by typing codeblocks.

    And thanks for this awsome guide

  • Jamal

    Is that OK to install C++ Visual 2008 instead of 2005 which not available on microsoft site.

  • jestuart

    I have been looking for a site that taught C++ usuing MS Visual Studio. LearnCPP.com pops up when searching for C++ tutorials but didnt pop up for me when I was searching for C++ tutorials usuing MS Visual Studio. I am gald I read this far, because now I am excited. The site seems very upto date in content so far and is usuing the compiler and environment I was looking for.

  • Grant

    I will be installing XCode on my Mac ASAP!

    (does anyone read these things?)

Leave a Comment

Put C++ code inside [code][/code] tags to use the syntax highlighter