When it comes to GCC, we have to mention the GNU project. GNU’s official name is GNU Not UNIX, also known as the “Genu Project”, which was started by Richard Stallman in 1983. The ultimate goal of the GNU Project was to create a completely free (that is, free to use, freely modify, and freely publish) open source operating system, which it initially named the GNU Operating System. (its logo is shown in ). Figure 1).

The implementation of the GNU program has had its ups and downs. Most importantly, even though the program has tailored the system kernel, named Thr Hurd, for the GNU operating system, its performance is not as good as the Linux kernel born in 2000. In the end, I gave up on the GNU program and chose Linux as the kernel for the hardware GNU operating system. Based on the Linux kernel, the GNU Project has developed many system components, one of which is GCC (and some very useful software such as Emacs).
From this point of view, the GNU Project has finally realized its original intention to “create a free and open source operating system,” but since the operating system was not entirely created by the GNU Project, the GNU/Linux operating system It is called. (People are used to calling it for Linux operating systems). Please note that open source and freedom does not mean no material.
The full name of GCC in its early days was GNU C Compiler, a C language compiler that grew out of the GUN project, but apparently GCC’s original position was really just for compiling the C language. However, after years of continuous iteration, GCC’s capabilities have been greatly expanded and it can now be used not only to compile C language programs, but also to compile C language programs written in C++, Go, Objective-C, and other compiled languages. You can also process programs. At the same time, the previous GNU C compiler was unable to fully interpret the meaning of GCC, so its full English name was redefined as the GNU Compiler Suite, GNU Compiler Collection.
The so-called compiler can be understood simply as a “translator”. You should know that computers can only understand binary instructions (instructions consisting only of 0’s and 1’s).The C language code, C++ code, Go code, etc. that we write every day. It is completely invisible to the computer; it can only execute binary instructions by translating each statement.
Therefore, the GCC compiler is no longer improved. As of today (May 2020), GCC has been developed from its initial version 1.0 to version 10.1, with hundreds of version iterations in between. As one of the most popular compilers, GCC has been ported to thousands of hardware/software platforms, and almost all Linux distributions also have the GCC compiler installed by default.
| hardware | operating system |
|---|---|
| alpha | Red Hat Linux 7.1 |
| HPPA | HPUX11.0 |
| intel x86 | Debian Linux 2.2, Red Hat Linux 6.2, and FreeBSD 4.5 |
| MIPS | IRIX6.5 |
| PowerPC | AIX4.3.3 |
| spark | solaris 2.7 |
The original GCC compiler did not have a familiar interface window, and to use it you would have to create a corresponding gcc command. The so-called original flavor refers to the pure GCC compiler and the development software (IDE) integrated with the GCC compiler. Compared to the former, the latter integrates the functionality of the GCC compiler while providing an easy-to-use interface window. Users can begin development work without having to remember gcc commands, significantly reducing learning costs for users.
Operating systems are broadly divided into two camps: the Windows camp and the Unix-like camp (which includes Unix, Linux, Mac OS, Android, etc.). Typically, users on Windows systems are accustomed to using their existing IDE to compile programs, but on Unix-like systems, users prefer to compile programs by directly writing the corresponding gcc commands. .
Now that you know what the GCC compiler is, we’ll show you an example of running a C language program using the gcc command on the CentOS operating system (a Linux distribution). This allows readers to experience functionality and usage more intuitively. GCC compiler.
Below is a complete C language program written in the vim editor. Its function is to output “Hello, World!”.

Figure 1 Creating a C language program on a Linux system
This program allows you to use the following gcc commands:
gcc demo.c -o demo.exe
The meaning of each part of the gcc command is explained in detail in subsequent chapters, so there is no need to go into detail here.
The following diagram shows how to use the gcc command to compile C language code into an executable file.

Figure 2 gcc command to compile a C language program
You can easily compile your written program into a binary executable file by writing and running the corresponding gcc command, as shown in Figure 2.
So how do you write gcc commands? Don’t worry. This will be explained in detail in the following chapters.




![How to set up a Raspberry Pi web server in 2021 [Guide]](https://i0.wp.com/pcmanabu.com/wp-content/uploads/2019/10/web-server-02-309x198.png?w=1200&resize=1200,0&ssl=1)











































