首页 > 编程语言 > 详细

C++ 的编译过程

时间:2019-03-23 23:03:37      阅读:163      评论:0      收藏:0      [点我收藏+]

Recall that g++ is not actually the C++ compiler – it is a driver program that hides a lot of the complexity of the compilation process from us. What is actually going on here is:

  • The C++ preprocessor is called to handle things like #include.
  • Preprocessed text is passed to the actual C++ compiler, which produces compiled assembly language code.
  • The assembly language code is assembled by the GCC assembler, producing an object code file.
  • The object code file is linked with the C++ libraries by the linker to produce the final executable.
  • The intermediate files are disposed of.

  • 调用 C++ 预处理器来处理 #include 等问题。
  • 预处理的文本传递给实际的 C++ 编译器, 它生成编译的汇编语言代码。
  • 汇编语言代码由 GCC 汇编程序组装, 生成一个对象代码文件。
  • 链接器将对象代码文件与 C++ 库链接, 以生成最终可执行文件。
  • 中间文件被释放。

C++ 的编译过程

原文:https://www.cnblogs.com/lion-zheng/p/10586088.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!