Reprinted from:
https://www.cnblogs.com/yadongliang/p/6100003.html
1. Installation
yum -y install gcc gcc-c++ autoconf pcre pcre-devel make automake
yum -y install wget httpd-tools vim
1. Just use gcc as a C language compiler and g++ as a C++ language compiler. (Knowing)
2.wget is a free tool that automatically downloads files from the Internet. After the user exits the system, it can continue to execute in the background until the download task is completed. (Baidu Encyclopedia)
2. Test (view version information, compile Helloworld)
a. View gcc version information
gcc --version
b. Write Helloworld
Create a file named ctest.c
touch ctest.c
edit the file
#include <stdio.h>
intmain ()
{
printf("hello world!\n");
return 0;
}
Compile gcc ctest.c
You can see that the a.out file is generated
execute a.out
./a.out
output result