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

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

  • AMG

    Hi Alex,
    Could you please provide your custom settings for IDE? Like your text editor colors and font. Thanks a lot.

    • Alex

      If you’re talking about my actual IDE (Visual Studio), I use the default. If you’re talking about the syntax highlighter on this site, that’s done via a WordPress plugin called Crayon. You’d have to download Crayon and tear apart the source code to see what colors and fonts it’s using.

  • Travis

    Thanks for writing this.  I hope you wrote all the tutorials, because it’s an easy read and very helpful.  Actually laughed out loud on some points.  I look forward to spending more time on this site.  Thanks!

  • Deku

    Hi, i have VS 2015 i registered and now i have some updates:
    -Microsoft Azure SDK 2.9.6
    -MIcrosoft SQL Data Tools (SSDT) Update
    -Microsoft ASP.NET and Web Tools

    If i update all of that is my VS going to be 2017 version ? Or should I uninstal Vs2015 and than download 2017 ?

  • Ashmin

    is it okay it shows me that it is only 5.32gb…..and should i install enterprise or community or professional???

    • Alex

      I can’t speak to the size requirement -- I’d assume it’s fine. You should install the community version unless you have a compelling reason to do otherwise.

  • Kbear

    Hey C++ teacher!!
    So i’m trying to download and install Visual Studio Community 2017 from your link but after i open the download and accept the terms and conditions, the progress bar shows up and once it reaches 100% it gives me this error "The specified service does not exist as an installed service.(Exception from HRESULT: 0x80070424)" i have no idea how to fix this.
    i have googled answers but nothing that helps.
    space is not an issue
    if you can help that would be amazing.

  • Hema

    you can suggest this- http://ideone.com/ This is an online compiler and IDE. It is very convient for beginners.

  • Kwaku

    Hello Alex I am trying to create my first C++ project but i need a cross compiler’s prefix and path. could you help please

  • Not telling you my name/email

    hi, ive just started, if i get any probs with Code::Blocks i’ll reply here k?

    Also, this is the second programming language im going to learn (original: Python)

    THX XD!

  • Mister teacher,

    I have a question:

    I have downloaded Visual Studio Community 2017 and now after 30 days it asks me to Register and pay.

    Do you know if I did something wrong?

    thanks

  • My dear c++ Teacher,

    Please let me one more question about Code::Blocks.
    In "Console application" window, does "Resulting filename" mean "Resulting file path"?

    With regards and friendship.

  • My dear c++ Teacher,

    Please let me following question.
    Recently I downloaded Code::Blocks 16.01.
    In compiler settings > Global compiler settings, after
    “Have g++ follow the C++11 ISO C++ language standard [-std=c++11]" there is
    "Have g++ follow the coming C++0x ISO C++ language standard [-std=c++0x]".
    Do you suggest it instead?

    With regards and friendship.

  • Seif El-deen

    hey alex

    i have a windows 10 laptop which IDE program would be suitable for me

    • Alex

      I recommend Visual Studio Community for anybody who can run it. I’m running Visual Studio Community on my Win10 laptop.

      • seif eldeen

        wow i didn’t think that you would reply but well i think that after i finish the c++ tutorial i will be able to do everything and i must encounter some problems in my learning journey so i think that i know where i am supposed to be asking for help

  • Aritra Das

    I download vc_redist.x86.exe(size-13mb).then i installed it but after installing i could not find what to do.I did not find the logo of microsoft visual c++  ..pls helpp…after this thing what should i download ..plz sent me the link

    • Alex

      You downloaded the wrong file. I have no idea where you found this file. The links in the lesson above contain links to the pages that contain the proper downloads (either Community 2017 or Express 2015 for Windows Desktop)

  • Khoi Nguyen

    Hello my teacher,
    I have just downloaded codeblocks and i got  the following error message "can’t find compiler executable in your search path(GNU GCC compiler)". Could you please help me with this?
    Thanks a lot!

    • Alex

      This is a common enough question that I’ve updated the lesson with some suggestions. Please have a read and let me know if any of these were able to resolve your issue.

  • Zach

    Hi Alex,

    Thanks for the excellent tutorials. As a complete new programmer, I hate to sound ignorant or knit picky, but I think it would be very helpful in this section 0.5 to make a note that Windows SDK 8.1 and Windows SDK 10s do not install automatically in VS Community 2017 with the Desktop Development with C++ selection, but they appear to be necessary for the following section. I ran into an error with my attempting to program "HelloWorld!" in the next section despite proper entry. The Solution would be to ensure on the individual components tab that Windows 8.1 SDK and all Windows 10 SDKs get installed along with Desktop Development with C++ from the get go. If Desktop Development with C++ installs without the SDKs, I found you can press the modify button when VS opens and select the SDKs for an update. I only mention the suggestion because I really appreciate the site and all you do, and I noticed some other new folks in 2017 were having an issue as well! From a completely new programmer perspective, I think it would be helpful to avoid an error in the next section! By the way, I am a Windows 7 user, and I apologize if this isn’t relevant for Windows 8 and 10. Thanks, and I hope this helps your site and isn’t a complete waste of space.

    • Alex

      You shouldn’t need the Windows 8.1 SDK, and the Windows 10 SDK installs by default.

      The screenshot in the lesson is the one the appears by default once you select “Desktop development with C++” -- You can see that Windows 10 SDK is selected by default. Was yours different for some reason?

      • Zach

        Yes. For some reason, the 8.1 and ALL the 10s didn’t install with the initial installation and after HelloWorld code tried to run, it would give me an error saying 8.1 was needed. So, I went back to install ALL the 10 and 8.1 and the code ran successfully thereafter.

  • James

    After installing codeblocks,I have tried compiling the program in the next tutorial("Helloworld") and it shows the following message:
    "hello - Debug": The compiler’s setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.
    Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)
    Goto "Settings->Compiler…->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler’s setup.
    Skipping…
    Nothing to be done (all items are up-to-date).

    Target uses an invalid compiler; run aborted
    The GNU GCC Compiler is installed though

  • John

    Hi, I just installed codeblocks on ubuntu using sudo apt-get install codeblocks, am I missing something because of that or is it good enough?

  • Vaerx

    Hey, I really hope this has a simple explanation but I Just downloaded "Microsoft Visual Community 2017" and I cant seem to get any codes to work. There’s no settings tab and codes like "std" and "cout" aren’t identified / highlighted any color. I try to run the tests anyway but i cant seem to figure it out. I don’t know, maybe I’m stupid.

Leave a Comment

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