[C++] 源文件编译过程

桃扇骨 2022-09-18 11:55 279阅读 0赞

1. 编译源文件成机器语言

Compile the source code.This means running a program that translates the source code to the internal language, called

machine **language**”, used by the host computer. The file containing the translated program is the object code for your program.

The compiler generates an object code file with an o extension.

2. 链接机器语言代码和使用的其他库的代码。

Link the object code with additional code.

For example, C++ programs normally use libraries. A C++ library contains object code for a collection of computer routines, called functions, to perform tasks such as displaying information onscreen or calculating the square root of a number.

Linking combines your object code with object code for the functions you use and with some standard startup code to produce a

runtime version of your program.The file containing this final product is called the executable code.

SouthEast

发表评论

表情:
评论列表 (有 0 条评论,279人围观)

还没有评论,来说两句吧...

相关阅读

    相关 C++源文件编译过程

    对于C++源文件,从文本到可执行文件一般需要四个过程:预处理阶段→编译阶段→汇编阶段→链接阶段。 预处理阶段:对源代码文件中文件包含关系(头文件)、预编译语句(宏定义)进行分

    相关 C++编译过程

    编译过程主要分为4个过程 1) 编译预处理 预编译程序完成的工作,可以说成是对源程序的“替换”工作。经过这个过程,生成一个没有宏定义、没有条件编译指令、没有特殊符号的输出文