Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-03-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report