Search

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.

Tip

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.

Mac OSX IDEs

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
Index
0.5 -- Introduction to the compiler, linker, and libraries

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

  • Josh

    Would C++ in the Unreal Engine be okay?

  • Aleks

    Ran,

    In VS Studio 2017 : "Debug" > "Options" > "Debugging" > "Symbols"      and "tick" the  
        "Microsoft Symbol Server".

  • Ran

    Although it does not affect the programming experience, I just not completely confortable with the following output message everytime I press F5 in my VS Studio 2017. Does any body know what's going on here?

    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Users\user\source\repos\ConsoleApplication4\Debug\ConsoleApplication4.exe'. Symbols loaded.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-localization-l1-2-0.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-processthreads-l1-1-1.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-file-l1-2-0.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-timezone-l1-1-0.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-file-l2-1-0.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-synch-l1-2-0.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\apphelp.dll'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cmd.exe'. Cannot find or open the PDB file.
    'ConsoleApplication4.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\cmd.exe'
    The program '[11696] ConsoleApplication4.exe' has exited with code 0 (0x0).

    • Alex

      This is the debugger telling you that it's unable to load debug files for various Windows DLLs. Since Windows doesn't ship with these files, it's just letting you know it can't find them. Consequently, if in the process of debugging, you step into a function that is contained in one of those Windows DLLs, the rich debugging information that is normally available won't be available.

      You shouldn't see these if you switch your build target to "release".

    • Aleks

      In VS Studio 2017 : "Debug" > "Options" > "Debugging" > "Symbols"      and "tick" the  
          "Microsoft Symbol Server".

  • James Johnson

    I suggest if you do not have a super fast Internet connection, start the download at night and go to bed. That's one big download!:)

  • Cruel World

    It's been two hours and my installation of Visual Studio is just 33%. How long it'll take more? And I really don't know weather this installation is going in right way or not.. :-/

    • nascardriver

      Hi Cruel World!

      Visual Studio is huge, you'll only need a fraction of the features it offers. Sadly MS doesn't offer a minimal version of it.
      You can already start with the first few lessons. If you make it to the coding lessons in time you can use an online compiler (eg. https://www.onlinegdb.com ) while waiting for your installation to finish.

  • Jeeba

    https://stackoverflow.com/questions/23254518/cant-find-file-executable-in-your-configured-search-path-for-gnc-gcc-compiler#23263169

    For Codeblocks if you get error in the right bottom corner.
    You will need to install compiler first.

    If you have installed Codeblocks already and after that install TDM-GCC then you can launch Codeblocks from Codeblocks launcher and there you can set GNU GCC compiler as default.

    It is missing from this quide, but was quite easy to find out.

    Hope it helps for people that have problems. :)

  • Saket Kumar

    dear sir downloading IDE for windows will take 6 gb for downloading or installing??

  • Ethan

    When I close codeblocks it says the perspective:code blocks default has changed. Do I save that? what does it do? I didn't the first time and it tells me every time I close the application. When I open it back up the follow the C++14 ISO C++ language standard [-std=c++14] is still checked.

  • ZPeU

    Help! Whenever i try to install Visual Studio 2015, it says I need a newer version of Windows. However, i have Windows 7 Ultimate. Any idea of what's happening? Oh, and by the way, my computer says my Windows version is not genuine (even though I payed for installation). Could that be the problem?

  • Sndn

    Why do we need Windows 10 SDK, profiling tools, tools for CMake and ATL support? Could you please explain why these are needed?

    • Alex

      It's unclear to me what the relationship between the Windows SDK and win32 applications is. My initial take is that the windows SDK is required to create Win32 applications. Maybe someone else with more knowledge of Windows can respond.

  • Jerome

    Is installing an IDE really one of the hardest things we'll do ?

  • Anjali

    Hello sir,
    In my college, they are using Turbo C++ and I just downloaded it. I think the only difference between these 2 is in turbo c++ the starting is:
    #include<iostream .h>
    #include <conio.h>

    And it ends with
    getch  ();
    I'm I right? Or is there anything more i wanna care??

    • Alex

      Turbo C++ is outdated and conio.h is not standard C++. As such, I can't advise on it here.

    • Turbo C++ was released in 1990, 8 years before the first C++ language standard was established.  Turbo C++ does not implement namespaces, templates and several other features that were mandated by the first standard.  Additionally, it can only compile 16 bit programs, which won't run on ANY Windows version after Windows 2000 without an emulator program.  It's use is strongly discouraged even in educational arenas, and the fact that your college is using it does not reflect well on the level of education you are receiving.  There are many other options that they could be using which are also free to use. (gnu, mingw, Visual Studio...etc.).  The ONLY possible rationale I can see for using Turbo C++ is if your college's computers are so archaic that they are 16 bit processors running DOS.

  • 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 all code inside code tags: [code]your code here[/code]