HOW TO INSTALL GCC IN UBUNTU ?


ABOUT GCC :

The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain. The Free Software Foundation (FSF) distributes GCC under the GNU General Public License (GNU GPL). GCC has played an important role in the growth of free software, as both a tool and an example.

Originally named the GNU C Compiler, when it only handled the C programming language, GCC 1.0 was released in 1987. It was extended to compile C++ in December of that year. Front ends were later developed for Objective-C, Objective-C++, Fortran, Java,Ada, and Go among others.
GCC has been ported to a wide variety of processor architectures, and is widely deployed as a tool in the development of both free and proprietary software. GCC is also available for most embedded platforms, including Symbian (called gcce),AMCC, and Freescale Power Architecture-based chips. The compiler can target a wide variety of platforms, including video game consoles such as the PlayStation 2 and Dreamcast.
As well as being the official compiler of the GNU operating system, GCC has been adopted as the standard compiler by many other modern Unix-like computer operating systems, including Linux and the BSD family, although FreeBSD is moving to the LLVM system and OS X has moved to the LLVM system. Versions are also available for Microsoft Windows and other operating systems; GCC can compile code for Android and iOS.

HOW TO INSTALL :
1. Open terminal and Install GCC Compiler. 
  • sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install build-essential
    gcc -v
    make -v
 
2. After install, try to make a C program language on gedit.

  • /* welcome.c */
    #include <stdio.h>
    main()
    {
      printf("Welcome ... );
      printf("Compile C, C++ On Ubuntu /n");
    }

3. Save it with welcome.c (/home/*user/Desktop)

4. Try to compile by type this command in terminal
  • cd /home/*user/Desktop/
    ls
    welcome.c
    gcc -c welcome.c
    gcc -o welcome welcome.c
    ./welcome

OUTPUT :
  • Welcome ... 
    Compile C, C++ On Ubuntu

No comments:

Post a Comment