Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
17 views1 page

GNU Compiler

GCC, or the GNU Compiler Collection, is a set of compilers and development tools for various operating systems, primarily supporting C and C++. It is free software developed by the Free Software Foundation and includes a toolchain for compiling code and preparing executable files. The document provides installation instructions for GCC on Ubuntu and a simple example of compiling a Hello World program.

Uploaded by

kartik i
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

GNU Compiler

GCC, or the GNU Compiler Collection, is a set of compilers and development tools for various operating systems, primarily supporting C and C++. It is free software developed by the Free Software Foundation and includes a toolchain for compiling code and preparing executable files. The document provides installation instructions for GCC on Ubuntu and a simple example of compiling a Hello World program.

Uploaded by

kartik i
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

What is GCC?

The GNU Compiler Collection, commonly known as GCC, is a set of compilers


and development tools available for Linux, Windows, various BSDs and other
operating systems. It includes support primarily for C and C++ and includes
Objective-C, Ada, Go, Fortran. The Free Software Foundation (FSF) wrote GCC
and released it as completely free (as in libre) software. GCC is a toolchain
that compiles code, links it with any library dependencies, converts that code
to assembly, and then prepares executable files. When you run GCC on a
source code file, it first uses a preprocessor to include header files and
discard comments.

Perform the steps below to install the GCC Compiler Ubuntu :


1. Start by updating the packages list:
sudo apt update

2. Install the build-essential package by typing:


sudo apt install build-essential
The command installs a bunch of new packages including gcc, g++

3. To validate that the GCC compiler is successfully installed, use the gcc
--version command which prints the GCC version:

gcc --version

The default version of GCC available in the Ubuntu repositories is 5.4.0:


gcc (Ubuntu 5.4.0-1ubuntu1~18.04)5.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software. GCC is now installed on your system, and you can
start using it.
Compiling a Hello World Example
Open your text editor and create the following file:
nano hello.c
This will create a binary file named hello in the same directory where you run
the command.
Execute the hello program with:
./hello

You might also like