Compiler is a software program that processes instructions written in a programming language and translates these instructions into a binary file that the computer’s CPU can understand and process/execute.
On the other hand, the build-essential software contains an informational list of software considered to be important for building Debian packages, including gcc compiler, make and other required tools. GCC (GNU Compiler Collection) and G++ (GNU C++ Compiler) compilers are the most well-known C and C++ compilers, respectively, for Linux-based distributions. These compilers were developed by the Free Software Foundation through the GNU (GNU's Not Unix!) project. To-date, the Free Software Foundation continues to maintain these program software. GCC is usually installed by default in Debian and its derivatives, however, all GNU/Linux distributions include packages for GCC.
You can install the latest available version of build-essential from the default distribution repositories by opening the Terminal and typing (remember to hit ENTER button):
Code: Select all
sudo apt-get update
sudo apt-get install build-essential
To run the C or C++ program, open the Terminal, navigate to the folder where your program resides, assuming your program name is program.c (C program) and program.cpp (C++ program), type respectively,
For C program:
Code: Select all
gcc program.c -o program #Compile the program
./program #Execute/run the program
and similarly for C++ program:
Code: Select all
g++ program.cpp -o program
./program
Code: Select all
gcc program.cpp -o outputfile
./outputfile
To install ccache, execute
Code: Select all
sudo apt-get install ccache
C++ emerged nearly a decade after C, and was developed with the goal of adding object-oriented programming features to C in mind. Its current form is often suited in embedded systems development, stunning game programming, mobile and desktop applications development, and anything related to interfacing software with hardware. Like C, C++ is favoured for its high-performance computing, particularly on large scales, and for other many technological applications. C++ is often treated as the "lingua franca" of desktop applications.
In summary, C and its extension, C++ are very useful and powerful for development areas related to machine systems such as kernels, computer application programs, and for solving complex problems due to their well-known high performance computing capabilities. However, C++ has currently found a lot of applications in web developments, especially, back-end programming.