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:
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
.
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.