0.6 — Installing an Integrated Development Environment (IDE)

An Integrated Development Environment (IDE) is a piece of software that contains all of the things you need to develop, compile, link, and debug your programs.

With a typical C++ IDE, you get a code editor that does line numbering and syntax highlighting. Many (but not all) IDEs include a C++ compiler and a linker, which the IDE will know how to interface with in order to convert your source code into an executable file. And when you need to debug your program, you can use the integrated debugger.

Furthermore, IDEs typically bundle a number of other helpful editing features, such as integrated help, name completion, auto-formatting, and sometimes a version control system. So while you could do all of these things separately, it’s much easier to install an IDE and have them all accessible from a single interface.

So let’s install one! The obvious next question is, “which one?”. Many IDEs are free (in price), and you can install multiple IDEs if you wish, so there’s no “wrong decision” to be made here. We’ll recommend a few of our favorites below.

If you have some other IDE in mind, that’s fine too. The concepts we show you in these tutorials should generally work for any decent modern IDE. However, various IDEs use different names, layouts, key mappings, etc… so you may have to do a bit of searching in your IDE to find the equivalent functionality.


You’ll want to install an IDE that has a C++11 capable compiler, as this tutorial assumes C++11 as a baseline level of functionality.

Visual Studio (for Windows)

If you are developing on a Windows machine (as most of you are) and disk space and download size are not a constraint, then we strongly recommend Visual Studio Community. 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++. If you do not do this, then C++ capabilities will not be available.

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.

Visual Studio Workload

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

Code::Blocks (for Linux or Windows)

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.

For Windows users

Make sure to get the version of Code::Blocks that has MinGW bundled (it should be the one whose filename ends in mingw-setup.exe). This will install MinGW, which includes a Windows port of the GCC C++ compiler:

Code::Blocks MinGW Windows download

For Linux users

Some linux installations may be missing dependencies needed to run or compile programs with Code::Blocks.

Debian-based Linux users (such as those on Mint or Ubuntu) may need to install the build-essential package From the terminal command line, type: sudo apt-get install build-essential.

Arch-linux users may need to install base-devel, which can be done via pacman -Syu base-devel.

Users on other Linux variants will need to determine what their equivalent package manager and packages are.

When you launch Code::Blocks for the first time, you may get a Compilers auto-detection dialog. If you do, make sure GNU GCC Compiler is set as the default compiler and then select the OK button.

Compilers Auto Detection dialog

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

Code::Blocks Settings > Compiler

Then find the box or boxes labeled Have g++ follow the C++XX ISO C++ language standard [-std=c++XX]:, where XX is 11, 14, or some other higher number (see the items inside the red box below for examples):

Code::Blocks C++11 setting

Check the one with the highest number (in the above case, that’s the C++14 option inside the red box).

Your version of Code::Blocks may also have support for experimental, or just released versions of C++. If so, this will be labeled Have g++ follow the coming C++11YY (aka C++XX) ISO C++ language standard [-std=c++ZZ] (see the blue box above). You can optionally check these if you would like to enable features in that version, but note that support may be incomplete (e.g. some features may be missing).

Q: I want to enable C++17 features in Code::Blocks, but I don't see a -std=C++17 option

If you see an option for -std=C++1z, that is equivalent (C++17 was called C++1z before they knew what year it would be finalized).

Alternatively, you can go to the Other Compiler Options tab and type in -std=c++17.

Code::Blocks Other Compiler Options

This will work if your compiler has C++17 support. If you’re using an older version of Code::Blocks and C++17 features don’t seem to work, upgrade your compiler.

Q: I'm getting a "Can't find compiler executable in your configured search paths for GNU GCC Compiler" error

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 going to settings, compiler, and choose “reset to defaults”.
  3. Try going to settings, compiler, toolchain executables tab, and make sure “Compiler’s installation directory” is set to the MinGW directory (e.g. C:\Program Files (x86)\CodeBlocks\MinGW).
  4. Try doing a full uninstall, then reinstall.
  5. Try a different compiler.


Popular Mac choices include 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.

Although Visual Studio for Mac has been released, as of Aug 2018 it does not support C++, so at this time we can not recommend it.

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.

Can I use a command-line compiler (e.g. g++ on Linux)?

Yes, but you’ll need to find your own editor and look up how to use it elsewhere.

When things go wrong (a.k.a. when IDE stands for “I don’t even…”)

IDE installations seem to cause their fair share of problems. Installation might fail outright (or installation might work but the IDE will have problems when you try to use it due to a configuration issue). If you encounter such issues, try uninstalling the IDE (if it installed in the first place), reboot your machine, disable your antivirus or anti-malware temporarily, and try the installation again.

If you’re still encountering issues at this point, you have two options. The easier option is to try a different IDE. The other option is to fix the problem. Unfortunately, the causes of installation and configuration errors are varied and specific to the IDE software itself, and we’re unable to effectively advise on how to resolve such issues. In this case, we recommend copying the error message or problem you are having into a Google search and trying to find a forum post elsewhere from some poor soul who has inevitably encountered the same issue. Often there will be suggestions on things you can try to remedy the issue.

Moving on

Once your IDE is installed (which can be one of the hardest steps if things don’t go as expected), or if you’re temporarily proceeding with a web-based compiler, you are ready to write your first program!

0.7 -- Compiling your first program
0.5 -- Introduction to the compiler, linker, and libraries

499 comments to 0.6 — Installing an Integrated Development Environment (IDE)

  • Mahendra

    After installing code blocks,in global compiler settings I found the [-std=c++11] and also C++14 ISO C++ language standard [-std=c++14]. According to instructions I selected [std=c++14] and clicked ok. Now whenever I restart code blocks, the toolbar item called “Build Target” becomes faid in colour hence can't switch between debug & release. Besides this, on restarting, under global compiler settings the [-std=c++14] is now vanished but [-std=c++11] is still there , so I have to check box C++11. On clicking other compiler options under compiler settings [-std=c++14] is showing. Every time when I opens code block the toolbar item called “Build Target” becomes faid or disabled by itself. What is the solution?

    • Alex

      When you start code::blocks, are you reopening a project? The build target should only be available once you've done so.

      • Mahendra

        Is that means if I edit any previous program one or more time then I can't get access to build and release function at the same time. Do I have to make new project again to get build and release function? And what about [-std=c++14] issue? why it vanished and present only in other compiler options tab(under compiler settings)?

        • Alex

          Once you create a project you should be able to reopen it and continue where you left off.

          I can't speak to why you're running into these issues, as it appears to be a program or configuration-specific problem. Perhaps ask on a code::blocks specific forum.

      • Mahendra

        Another problem: After making the very first program "hello world" when I press build(ctrl+f9) it shows:

        === Build file: "no target" in "no project" (compiler: unknown) ===

        === Build finished: 0 error(s), 0 warning(s) (0 minute(s), 10 second(s)) ===

        Why "compiler: unknown" is showing in the first line? Although program executes successfully.

        • Alex

          It sounds like your IDE hasn't been set up properly somehow. If I were you, I'd try uninstalling code::blocks, rebooting, and then try installing again. If you see the same thing, maybe try a different IDE.

  • Moofuqer

    Im using WinXP, and when I install CodeBlocks I keep getting message/notification "Cant find compiler executable in your configured search paths for GNU GCC compiler" - thats my first problem.

    Second is that, when I write a program altho i have this compiler problem, i get this message in CodeBlocks "Debugger" section
    "Error : You need to specify a debugger program in the debuggers´s setting.
    <<For MinGW compilers, its "gdb.exe" (without the quotes)>>
    <<For MSVC compilers, its "cdb.exe" (without the quotes) >>

    Thank You in advance.

  • Im 15, and I'm trying to get a head start on C++ and Java because I want to work at Treyarch(cliche I know lol) but this seems as if it requires previous knowledge of C++. Is this guide good for people that know absolutely nothing(me) about coding or software in general?

    • Alex

      This tutorial does not assume you have any prior programming experience. Everything you need to know, you will be taught along the way.

  • I find Code::Blocks better because that's the one I find the layout more I guess logical

    • Cameron

      "Learn - 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.

      Heh- right after i say it's perfect

      EDT I dum nvm

  • barry

    Hello do you still have instruction for visual studio 2015? I just got a new laptop, but I don't know  what components of visual studio 2015 i should install on my laptop

  • Ray

    Can I use Netbeans for C++? I have seen there is an option for developing C++ programs in Netbeans but the Netbeans Installed in the PC I am using is used for writing Java Programs.

  • adam

    if you ever start coding try this exact code

    #include <iostream>

    int main(){cout << "hello\n";


  • Christoph

    Which Workloads/Individual components should i install with the new Visual Studio 2017 to be able to follow this tutorial ?

  • Rodriguez

    Which program is the best if you're using a Chromebook provided by the school?

    • mpthompson

      I love my own personal Chromebook, but unfortunately it's not suitable for learning C++ (or most other computer languages) as it isn't intended to support applications such as compilers, code editors or IDEs.  With some effort, some Chromebooks are capable of running Linux which is ideal for learning C++, but your school probably has your Chromebook configured in such a way that it can't be reconfigured in this manner.

      To learn C++, you don't really need a powerful computer.  Pretty much anything able to run a modern version of Windows (7, 8, or 10) or Linux should be fine.  For instance, if you are somewhat adventurous, you can get a Raspberry Pi 3, install Raspbian Linux on an SD card and run the Code::Blocks IDE to learn C++.  A Raspberry Pi costs less than $40, but you will need to scrounge up a second hand USB keyboard, USB mouse, HDMI monitor and 5 volt power brick to get a complete system running. With some searching around secondhand stores you may be able to put it all together for less than $80. There are tutorials on YouTube and in the Raspberry Pi forums that will guide you through the process of configuring a Raspberry Pi and getting Code::Blocks running.

      • Alex

        You can also use a web-based compiler as an option of last resort. They're pretty limited, but if that's all you have access to it's certainly better than nothing.

  • Kush

    Hey Guys just started with these tutorials and are really looking forward to the rest. I just want to know if anyone recommends QT (my IT teacher at school said he will supply me with a copy cuz internet is really shit where I live). Just keep in mind that I am a complete beginner. I am on a windows machine.

    If you guys recommend QT, do I need to know anything else to use QT or can I just follow the tutorials?

    • Alex

      QT isn't a compiler, it's a cross-platform application development framework that's used with other compilers. QT is a fantastic framework, but you won't need it for these tutorials.

  • Thanks for IDE tutorial, Going to use xcode. But cannot we use sublime text with some plugin?

  • vimanyu

    C++ 17 is coming guys!!

  • moot

    It might also be worth adding that Visual Studio Code is now available for any os...

    • Alex

      Visual Studio Code is great, and super flexible, but it's not easy to set it up to compile programs. Therefore, I can't in good conscience recommend it to new programmers.

  • Devangshu Mitra

    I am downloading XCODE for MAC OS. Any specific instructions or settings i shall have to enable? Greetings

  • Brian

    Hm, is it okay if I just stick with Vim, GDB and the terminal to write/compile/test/debug programs rather than using an IDE? Kinda want to learn how to work with these rather than use an IDE, at least for now.

  • Neraxa

    I use Visual Studios and when i try to debug my project through the Local Windows Debugger, I get the message:
    Unable to start program, the file was not found.
    I have tried to locate the file manually, but could not find it.
    I have also tried to look for something named 'compile' but found nothing.
    Is this the correct way I have tried to start my project, or is there another?

    • Neraxa

      ( I have used both the debug and the release configuration to see if it worked, but it came with the same answer ... it would be strange if the file did not exist at all, because it is saved. )

    • Alex

      It should just work. Sounds like something didn't get set up correctly. Try recreating your project again.

  • Khush

    How to download Visual C++. I have already downloaded Visual Studio Community 2015 for my Window 10 laptop.

    • Alex

      Visual C++ is part of Visual Studio Community 2015. If you didn't enable that option when you installed, there should be a way to enable it from within the application (from within the create new project dialog).

  • My dear c++ Teacher,
    Please let me say that, recently I found this "ide" online:
    It looks to me good. Do you suggest me that?
    With regards and friendship.

    • Alex

      For compiling simple programs, it seems sufficient. However, as with all web compilers, there is no way to debug your programs, so I would not recommend it for anything non-trivial.

      • My dear c++ Teacher,
        Please let me say that, unfortunately, it is not sufficient even for simple programs. It does not execute "std::cin" object. However compiles and executes programs with files, apart object "std::cin".
        With regards and friendship.

        • Alex

          You appear to be incorrect. I was able to compile and execute the following program just fine:

          To enter your input, you need to click on the green console area first to ensure it has focus.

  • rock

    i have ide called turbo c++.Is it an ide and will it work for what we will be doing here.
    and thanks for the website it is awesome

  • lexy

    Time to embark on the journey ahead. I feel this guide will be very fun to follow. I'll see all of you at the end :)

  • Absar

    Hi Alex
    This guide is very good and easy to understand. Well done. My question is that what are the minimum system requirements to program on visual studio express 2013 ? Actually I'm about to go to college to study computer engineering, that's why I want to learm c   but can't afford an expensive laptop.

  • RudyR

    Hello there. This site has been quite helpful to me since i missed classes and our teacher memorises the code and teaches us instead of understanding .. so so.
    Anyways it won't be an issue if i use turbo c++ to do these programs right?
    Thanks again for this wonderful tutorial! Cheers!

    • Alex

      Turbo C++ is a deprecated compiler that does not comply with modern standards. You really should not be using it. You're better off downloading and installing Visual Studio or Code::Blocks instead (if you can).

  • Liam

    Isn't c++ usually used to make video games?

  • Patrick McDaniel

    I have code::blocks set up on ubuntu 16.04 and I'm having a lot of trouble with it.  Everytime I try to compile a project it gives the same error "unterminated quoted string"  I can't find any information on this.  To rule out all possibilities I copied and pasted the code for "Hello world!" and I copy and pasted several other simple programs (inside and outside of this tutorial) as well as manually typing them.  I decided to use Geany as my IDE which was working great until I got to section 1.8 where I could not continue because you can't make a project with multiple files.

    I think I have some setting wrong in code::blocks I copied and pasted many of the simple programs in this tutorial to both IDE's and geany worked every time and code::blocks gave me the same "unterminated quoted string" error.

    If anyone can help me it would be greatly appreciated I searched comments on here and I've been googling the problem since it started a week or so ago to no avail.

    • Patrick McDaniel

      I solved the problem above ^  its so easy that I can't believe I didn't think to try it for so long.  I was saving my projects in a folder called "Patrick's stuff" and the apostrophe in "Patrick's" was throwing it off.  Maybe I missed this in the tutorial but it might be worth mentioning.  The only people that I could find with this problem were ubuntu/code::blocks users so it might only affect users with that combination.

    • Alex

      Glad you figured it out. Hopefully this comment will help other readers who encounter the same situation.

  • Garry E

    I see my earlier comment about my difficulties with Codeblocks has disappeared. However, with the help of
    Carl Herolds' video on You Tube I have finally learned how to manipulate Codeblocks. After the installation
    process is complete and the program is launched the first few screens take you through some housekeeping
    tasks. Then a gray screen appears. Go to menu bar above and click on View menu. Click on Manager. Go to
    Workspace pane on left hand panel. Click on main. "Hello World!" program appears in Editor pane. Go to Build menu above and click on Build/Run. Hello World! appears on output screen. Next, delete what you don't need from "Hello World!" and type your program in its' place. Again go to Build menu and click on
    Build/Run. If you have not goofed up, your program should perform as expected. If not there's
    a ton of stuff at the end of Chapter 1 of this tutorial about what to do next. Which is where I am at now.

    One final comment: deleting a bunch of code to get a clean editor seems like a totally Mickey Mouse way
    to design an IDE!

  • Joey

    XCode is taking forever to install, and as I am 13, I am spending my time typing stupid comments on the Internet!

  • Garry E

    Cheers to you for this great website! I imagine that others have told you that the user interface for
    Codeblocks 16.01 is different than earlier versions and thus your screen shots are obsolete. In particular,
    after the first 3 screens you end up with a gray screen. To get the Management pane you must go to the View
    menu in the Menu Bar at the top of the screen and click on Management. Then, if you entered "Hello world!"
    as the title of your program, sure enough after clicking on main.cpp under the projects tab you do indeed
    get the proper code to generate "Hello world!" on your monitor.

    I have used CB for C coding practice and find it to be very frustrating. For example, if I choose "Console Application" and enter something other than "Hello world!" I have not been able to discover how to get a pure Editor screen. One ploy I have tried is to generate Hello world code, delete that and then write my own code. After that I can debug and compile. After pressing RUN I get one of 2 results: either
    "Hello world!" appears on the screen or "It appears that your file has not been built yet. Do you wish to build it now?" Clicking on yes leads absolutely nowhere! Clearly I'm doing something wrong. I have found
    that a better way is to avoid using Console Application altogether. In the file menu choose New and select
    the File option in the drop down menu. After entering the file path and file name you get the editor for a
    source file. The downside to this seems to be that you can run the program only once. After that the build
    menu shuts down.

    Finally, C coding in Dev.cpp has been less frustrating for me than CB. However, someone wrote a message in the Codeblocks blog saying that the Dev.cpp developer was no longer maintaining the website and they suggested that new users should be aware of the risks before downloading the program.

    • Alex

      What you describe sounds rather strange, but I'm not familiar with the latest version of Code::Blocks. I'll have to check it out and update the screenshots once I'm back from vacation.

  • GEScott71

    I appear to have successfully installed Visual Studio.  I'm at the start page and it feels like I'm about to enter a new world!

    I am going to install Code::Blocks as well, but I need to free up some more drive space first.  I want to do everything in the tutorial, for a while anyway, on both IDEs as I think it will give me a better foundation going forward. If this is a complete waste of time I'm open to input!

    • Alex

      I encourage you to check out both IDEs. But realistically, once you've compiled a few programs with each, there's probably not much to be gained by continuing to do so beyond that point.

  • Hi Alex,
    I am from India and I really love your lesson's.
    I just wanted to know that in our institute we are using Turbo C++3.20 for writing programs in c++. Can you Please is it fine to use it with your tutoriols or I need to use this visual c++ ??

    • Alex

      Turbo C++ is very outdated. You would be better off upgrading to a compiler that supports C++11, such as Visual Studio or Code::Blocks. They are both free. If you can not install new software, then perhaps an online compiler would be a viable choice for you (though they make debugging difficult).

      • Our institute is teaching all codes on turbo i installed code blocks with borland compiler and its running same as turbo c++ codes now.
        But in you tutuorials i am facing problem 's,since everything is not explained here. I am beginner just started coding now .
        Its the time to move on right path and with your guidance i think i can fulfill it.
        Please help!

        • Alex

          A few thoughts:

          1) Many times I'll come back to things later once I've covered other prerequisite topics first. So if you don't see something, keep reading through the lessons. It may be in a future lesson.
          2) Analogy time: If you were learning English, I couldn't teach you every word in English. There's just too many words. So I'd focus on giving you fundamentals: key words, plus rules about how to conjugate verbs, that sort of stuff. Once you learn enough of the basics, suddenly you can start learning more by talking to others, by using a dictionary, etc... This tutorial is similar. We won't cover everything in C++ (that would require a 1000 page book, maybe 2000 if there are lots of examples). But I will teach you lots of fundamentals and context. Then you can go out and learn all the other stuff yourself, using supplemental materials.

  • Erad

    Hi Alex,

    Thanks for this great collection of C++ concepts and topics you have on your site here. I fell in love with your site after reading your explanation on the distinction between the 'heap' and the 'stack.' By the way, I am a self-taught C++ programmer and have been using the DevC++ IDE to run my programs. But I am disappointed that, for some reason, the current DevC++ IDE I have does NOT have a means to enable the C++11 option!! That is why I'm trying out the Code::Blocks IDE on here.

    I have successfully downloaded and installed the IDE and even run the 'Hello World' program. However, I couldn't find this crucial option under Settings->Compiler-> "Have g++ follow the C++11 ISO C++ language standard [-std=C++11]" This is the text enclosed in the red rectangle in your literature.

    Please how can I get this very much needed C++11 option enabled?

    • Alex

      You may have downloaded the wrong version of Code::Blocks. Have a read of some of the answers here and see if they help.

      • Erad

        I downloaded the "codeblocks-16.01mingw-setup.exe" version from the Code::Blocks link in your literature. I would think that's the correct one to download. Right?

        I checked the link you provided in your reply; the post on there is actually the same problem I encountered. That "Have g++ follow the C++11 ISO C++ language standard [-std=C++11]" is curiously missing in the Settings->Compiler settings->Compiler Flags path!! One entry on the StackOverflow site suggests using the " ...[-std=C++0x]" option. I am yet to try that to see how it works out.

        • Alex

          Yes, the 16.01mingw version should have a C++11 compatibility mode.

          I'm not sure what else to suggest. Please respond back if you find a solution, so that other readers who encounter this can be helped.

          • My dear c++ Teacher,
            Please let me say I had same problem with codeblocks-16.01mingw-setup.exe for  Windows XP / Vista / 7 / 8.x / 10. I used " …[-std=C++0x]" option but does not work.
            Hopefully Dev-C++ 4.9.92 works!
            With regards and friendship.

Leave a Comment

Put all code inside code tags: [code]your code here[/code]