Get notifications on updates for this project. Get the SourceForge newsletter. Get newsletters and notices that include site news, special offers and exclusive discounts about IT products & services. Sep 30, 2015 Read Also: Install C, C and Development Tools in RHEL/CentOS/Fedora. In this article we will explain how to install C and C compilers and it’s Development Tools (build-essential) related packages such as make, libc-dev, dpkg-dev, etc. In Debian and derivatives such as Ubuntu and Linux Mint.
ow do I install GNU/GCC compiler and related tools (such as make, debugger, man pages) collection under Debian Linux system using command line options?
Basically, build-essential package contains an informational list of packages which are considered essential for building Debian packages including gcc compiler, make and other required tools. This package also depends on the packages on that list, to make it easy to have the build-essential packages installed.
Open the Terminal and then type the following apt-get command as root user or use the apt command:$ sudo apt-get update
$ sudo apt-get install build-essential
OR$ sudo apt update
$ sudo apt install build-essential
Sample outputs:
You can verify gcc compiler and make tool using the following syntax:$ whereis gcc make
$ gcc -v
$ make -v
Sample outputs:
Now, you should able to compile software, create Debian packages or simply write a code using C / C++ compilers.
Type the following command:$ sudo apt-get install manpages-dev
Sample outputs:
Verify installation by reading some man pages:$ man ls
$ man printf
ADVERTISEMENTS
Basically, build-essential package contains an informational list of packages which are considered essential for building Ubuntu packages including gcc compiler, make and other required tools. This package also depends on the packages on that list, to make it easy to have the build-essential packages installed. In this tutorial, you will learn about installing the GNU C compiler and GNU C++ compiler on a Ubuntu Linux.
Open the terminal app and type the following apt command/apt-get command:$ sudo apt update
$ sudo apt upgrade
$ sudo apt install build-essential
OR$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential
Sample outputs:
Type the following commands:$ whereis gcc make
$ gcc --version
$ make -v
Type the following command:$ sudo apt-get install manpages-dev man-db manpages-posix-dev
To view library calls (functions within program libraries), enter:$ man 3 scanf
$ man 2 execve
$ man 2 fork
You can write a small program to test GNU c/c++ compiler:$ vi test.cpp
Append the following code:
Save and close the program. You can compile it as follows:$ make test
OR$ g++ test.cpp -o test
You should get an executable named test in the current directory:$ ls -l test
Sample outputs:
Just run it:$ ./test
Type the following command:$ sudo apt install libx11-dev
ADVERTISEMENTS