C development environment under Linux Introduction

Lead

Linux operating system kernel is mainly written in C,Many Linux software is written in C,For example, MySQL、Apache, etc.。Beginners When compiling such software,You will encounter a variety of errors,Just a preliminary understanding of the Linux C development environment,Preferences can resolve some errors during installation。

Linux's C Development Kit

Linux and Windows C development environment is different,Under Linux,A complete C development environment consists of the following three components:

1、Library: glibc

To frame a complete C development environment,glibcIt is essential,It isLinuxThe main library in C。glibc isGNUReleased libc libraries,That c runtime。glibc is the Linux system, the bottom of the api (Application programming interfaces),Almost any other runtime will depend on glibc。glibc package in addition to the Linux operating system, system services provided by outside,It also offers itself to achieve many other necessary functions and services。

installationglibcRelevant to the needs of the additional package dependencies:

These two packages in many Linux systems already installed by default,If not installed you can install in the yum or apt-get service,You can also use iso CD installation source files via command。

2、translater:gcc

gcc(GNU CCompiler)GNU is the introduction of powerful、Superior performance of multi-platform compiler,gcc C compiler can、C ++ language source、The Department of stylized sequences and the target program compilation、Connection into an executable file,The following is a suffix and its interpretation gcc compiler supports some of the source files:

  • .c suffix file,C language source code files;
  • .a file with the extension,Archive file is constituted by the target file;
  • .C,.cc or .cxx file suffix,It is a C ++ source code file;
  • .h file suffix,The header file is included in the program;
  • .i suffix file,It is already preprocessed C source code files;
  • .ii file suffix,It is already preprocessed C ++ source code file;
  • .m for the file suffix,It is Objective-C source code file;
  • .o suffix file,Object file is compiled;
  • .s file suffix,Assembly language source code files;
  • .S suffix for the file,Is precompiled assembly language source code files。

3、System header files:glibc_header

The lack of a system header file, then,Many used system functions C program will not compile。

[warning]
If the user during the installation of these packages installed less,C source code will not compile。Beginners sometimes choose their own custom packages to install,The results of these packages are missing,Cause not compile source code,Linux system had to reinstall it again。
[/warning]

Original article written by Gerber drop-off:R0uter's Blog » C development environment under Linux Introduction

Reproduced Please keep the source and description link:https://www.logcg.com/archives/450.html

About the Author

lucifer

Leave a Reply

Your email address will not be published. Required fields are marked *