1 / 55
文档名称:

linux系统编程(1).ppt

格式:ppt   大小:456KB   页数:55页
下载后只包含 1 个 PPT 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

linux系统编程(1).ppt

上传人:相惜 2021/4/10 文件大小:456 KB

下载得到文件列表

linux系统编程(1).ppt

相关文档

文档介绍

文档介绍:编程工具包
GNU CC (GNU Compiler Collection)
GNU make 管理项目
GDB (GNU DeBugger)调试
.
1
GNU CC
GCC的特性
面向多种语言 C,C++,Objective C,Pascal,Ada,Fortran
能够对编译过程有更多的控制
可以控制嵌入在二进制执行文件中调试代码的数量和类型
可以优化执行代码
有30多个警告和3个一般警告级
可以进行交叉编译
对C和C++进行了大量扩展
.
2
GNU CC
C程序的编译过程
源代码
*.c
预处理器(cpp)
编译器(cc)
目标代码
*.o
链接器(ld)
可执行文件
头文件
*.h
库代码
引导代码
.
3
GNU CC
实例
.
4
GNU CC
实例
在预处理后停止编译过程
.
5
GNU CC
实例
从指定的步骤开始编译
只编译不链接
.
6
GNU CC
对文件扩展名的解释
——For any given input file, the file name surfix determines what kind of compilation is done.
C source code which must be preprocessed.
C source code which should not be preprocessed.
C++ source code which should not be preprocessed.
C or C++ header le to be turned into a precompiled header.
, , , , , ++,
C++ source code which must be preprocessed. Note that in .cxx, the last two letters must both be literally x. Likewise, .C refers to a literal capital C.
, C++ header file to be turned into a precompiled header.
Assembler code.
Assembler code which must be preprocessed.
.
7
GNU CC
常用的命令行选项
-x language
Specify explicitly the language for the following input files (rather than letting the compiler choose a default based on the file name suffix). This option applies to all following input files until the next -x option.

Possible values for language are:
c c-header cpp-output
c++ c++-header c++-cpp-output
assembler assembler-with-cpp
-x none
Turn off any specification of a language, so that subsequent files are handled according to their file name suffixes (as they are if -x has not been used at all).
.
8
GNU CC
常用的命令行选项
——-x和下述几个选项结合实现分步编译
-c Compile or assemble the source files, but do not link.
-S Stop after the stage of compilation proper; do not assemble.
-E Stop after the preprocessing stage; do not run the compiler proper.
-o file Place output in