本文介绍了难道没有GCC g ++的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问G ++编译不GCC或G ++只是翻译//包括旧G ++版本。

当我试图从源代码,我看到文件安装G ++

/* Default prefixes to attach to command names.  */

#ifndef STANDARD_EXEC_PREFIX
#define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-"
#endif /* !defined STANDARD_EXEC_PREFIX */

//from g++1.4*

Well i know that c++ is c with classes i just wanted to know if the g++ can compile c++ without gcc .

解决方案

With a recent GCC, gcc (actually cc1 which is run by gcc) and g++ (actually cc1plus) -and so on for other GCC compilers, e.g. gfortran or even gdc ....- share a lot of (source) code together: the middle-end (where most optimizations happen) and the back-end. The difference is only the front-end layer of the compiler (the only layer being source language specific) which is less than 30% of the compiler.

Actually the gcc program is able to compile C++ source code (and likewise g++ can compile C or Fortran code). However, they are not linking the same libraries.

Pass the -v flag to the gcc or g++ command to understand what they are running.


Here are two (mine) [CC-BY-SA] pictures -explaing GCC & MELT- illustrating this.

The three layers -front-end, middle-end, back-end- of the compiler:

with your plugin, or the MELT meta-plugin

and

another view of the internals of cc1 or cc1plus,

which generates some assembler code

这篇关于难道没有GCC g ++的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 21:48