Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to install GCC on CentOS 8 to realize the function of development and compilation

Shulou Source: shulou.com Published: 2022-06-01 03:15:45 11月14日 Update

This article will explain in detail how to install GCC on CentOS 8 to achieve the development and compilation function, the content of the article is of high quality, so the editor shares it for you to do a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

GNU Compiler Collection (GCC) is composed of compilers and libraries of C, C++, Objective-C, Fortran, Ada, Go and D programming languages. Many open source projects, including the Linux kernel and GNU tools, are compiled in GCC. The CentOS default repository contains a package group called Development tools, which includes the GNU compiler collection, the GNU debugger, and other development libraries and tools needed to compile the software.

Install GCC and configure GCC

To install the GCC SDK, you must run the following command as root or a user with sudo privileges, which I installed here as the root user:

Install the development tool set

[root@ece2cd92dada ~] # dnf group install "Development Tools"

The above command installs a number of software packages, including gcc, Gmail +, and make

Install the development tools manual

[root@ece2cd92dada ~] # dnf install man-pages

Verify that GCC is installed successfully

[root@ece2cd92dada] # gcc-- versiongcc (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4) Copyright (C) 2018 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Vim writes a C language "Hello World"

[root@ece2cd92dada ~] # vim hello.c#includeint main () {printf ("Hello World!\ n"); return 0;}

GCC compiles hello.c files to generate hello binaries

[root@ece2cd92dada] # gcc hello.c-o hello

Run the compiled hello binary program

[root@ece2cd92dada ~] #. / hello Hello World!

On how to install GCC on CentOS 8 to achieve the development and compilation function is shared here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Compile develop tools commands development tools software functions binaries content articles more users knowledge programs articles compilers languages identities software packages run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Linux Docker MySQL Apple