Setting up Environment for C++ Programming

Discussion in 'C++' started by MinalS, Nov 25, 2015.

  1. For learning the C++ programming, user needs the right development environment. The environment can be set up on various operating systems. In this article, we shall explore the local environment setup and installation on different operating systems.

    In order to set up a development environment for C++ programming, a compiler must be available on the user system and use a text editor to write your C++ Programs.

    Text Editor

    The text editor is used for typing the C++ program. The version of the text editor to be used is dependent on the operating system on which it is installed. The various editors available for the users to add the code are EMACS, notepad, OS Edit Command, Vim, vi, etc.

    All the files created in the text editor are with the .cpp, .c or .cp extension. The files in the editor are known as source files.

    C++ compiler

    A compiler is used to compile C++ source code written in a text editor to an executable program. The .cpp is the default extension used by the C++ compilers for source code and you can define the header files as .h extensions.

    The GNU C/C++ compiler is free compiler but there are many other compilers like Turbo C++, Borland C++ or even Microsoft C++ Compiler.

    Installing C++ compiler on Various OS



    Linux / Unix

    1. For installing the compiler on the Linux/ Unix operating system, the GCC must be installed on the system
    2. Once installed, add the following command to the command line
      Code:
      $ g++ -v
    3. The appropriate message is displayed if the GCC is installed on the user system

    Windows Installation
    1. User can add the GCC at Windows using the MinGW installation. It is available at the MinGW page.
    2. From the page, download the latest version of the program
    3. The name of the latest version is MinGW - <version>.exe
    4. Install the gcc – core, gcc –g++, binutils, etc as per the user requirements
    5. Add a subdirectory to the MinGW installation to the PATH environment variable
    6. Once the installation is done, the user can easily execute the gcc, g++, ar, etc GNU tools from the command line
    Mac OS X Installation
    1. For installing the GCC, download the Xcode development from the Xcode apple website
    2. The installation instructions are available at the web page
    3. Follow them and complete the installation process
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice