Other topics of note:
make
, CMake, MesonCompilers translate one language to another. This typically means translating from a language that humans easily can understand to one that a computer can act on. Many compilers more or less attempt to adhere to language standards, but implementation differences can have a big impact on how that translation occurs.
Formerly the GNU C Compiler, the original compiler developed by Richard Stallman has grown into the GNU Compiler Collection (GCC), which makes up the GNU toolchain that consists of the following:
make
)gdb
)Assuming a simple Hello World example C program, GCC can be used to compile it as follows:
gcc hello.c
This will generate an executable named a.out
. To compile
C++ one simple needs to use g++
instead of
gcc
. Significant flags for both include:
-o
to specify an output executable filename-Wall
to print all warning messages-g
to generate additional symbolic debugging
information for use with gdb
The above example compiled the source code into an object file and then linked it with other object files into an executable in one step. They may be separated into two steps:
g++ -c Hello.cpp
g++ Hello.o