Foreword
This article will guide you with detailed steps to deploy C-language development environment under Linux,Due to numerous Linux distributions,Specific circumstances vary,As used herein, the classic example of RHEL5。
Installation under Linux C development kit
Linux C development kit can be installed under the yum service,You can also use iso CD installation source files via the command rpm,Here are the source files using iso CD installation kit。
1、Mount CD
- In / media New Folder cdrom :mkdir /media/cdrom
- Mount the RHEL5 installation disk dvd: mount /dev/cdrom /media/cdrom
2、Installation dependencies
Iso CD into the source files Server directory,As shown below:
View Dependencies
According to dependency,The total installed package can be summarized in the following command:
So the whole installation procedure should be:
1 2 3 4 5 6 7 8 9 10 |
[root@localhost Server]# rpm -ivh kernel-headers-2.6.18-53.el5.i386.rpm [root@localhost Server]# rpm -ivh glibc-headers-2.5-18.i386.rpm [root@localhost Server]# rpm -ivh glibc-devel-2.5-18.i386.rpm [root@localhost Server]# rpm -ivh libgomp-4.1.2-14.el5.i386.rpm [root@localhost Server]# rpm -ivh gcc-4.1.2-14.el5.i386.rpm 如果需要C++的环境可以安装libstdc++-devel和gcc-c++两个包: [root@localhost Server]# rpm -ivh libstdc++-devel-4.1.2-14.el5.i386.rpm [root@localhost Server]# rpm -ivh gcc-c++-4.1.2-14.el5.i386.rpm |
End
After installation,Constitute the basic C development environment,In this C development environment,You can compile an application written in C, the majority of。For a C program for,After installation may generally be divided into three components:
- executable file
- Include files
- Library file
The final executable file is the command to run,Some definitions include file is the file C program include the,The library is the C program custom libraries。For example, for useRPMInstalledMySQL:Executable file in the / usr / bin,Include files in / usr / include / mysql under,Library files in / usr / lib / mysql。Only the system can find the include files and library files corresponding to the program,Executable file to run properly。
Original article written by LogStudio:R0uter's Blog » How to install Linux under the C development environment
Reproduced Please keep the source and description link:https://www.logcg.com/archives/452.html