CentOS / RHEL 7: Install GCC (C and C plus plus Compiler) and Development Tools

www.l‮ruttua‬i.com
CentOS / RHEL 7: Install GCC (C and C plus plus Compiler) and Development Tools

To install the GCC C and C++ compiler and development tools on CentOS or Red Hat Enterprise Linux (RHEL) version 7, you can follow these steps:

  1. Install the Development Tools package group using the yum package manager:
sudo yum groupinstall "Development Tools"

This will install the GCC C and C++ compiler, as well as other development tools such as make, gdb, and git.

  1. To check if the GCC compiler is installed and working correctly, you can try compiling a simple C or C++ program. For example, create a file called hello.c with the following contents:
#include <stdio.h>

int main(void)
{
    printf("Hello, world!\n");
    return 0;
}

Then, compile the program using the gcc command:

gcc hello.c -o hello

This will create an executable file called hello. You can run the program by typing:

./hello

This should print "Hello, world!" to the console.

Note: These steps will install the GCC compiler and development tools on your system. If you need additional development libraries or tools, you can install them using the yum package manager. Consult the documentation for your specific development needs for more information on what packages to install.

Created Time:2017-10-16 14:38:40  Author:lautturi