编译文件依赖 [英] compilation file dependency

查看:80
本文介绍了编译文件依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

c中的编译一般有四个阶段

1.预处理

2.编译

3.汇编

4.链接。


如果我使用的标志不会链接代码,编译顺序不是

问题,对吧?我不熟悉编译器,所以我不确定。它似乎在我看来,* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *依赖关系只是链接过程中的一个问题?


谢谢,Mike

Compilation in c generally has four phases
1. Preprocessing
2. Compilation
3. Assembly
4. Linking.

If I use a flag that will not link the code, order of compilation is not an
issue, right? I am not that familiar with compilers so I am not sure. It
seems to me that it would not make a difference as to *which* file was
compiled *when*. Dependencies are only an issue during linking?

Thanks, Mike

推荐答案

Michael Gaab写道:
Michael Gaab wrote:
c中的编译一般有四个阶段
1.预处理
2.编译
3.组装
4.链接。

如果我使用的标志不会链接代码,编译顺序不是问题,对吧?我不熟悉编译器,所以我不确定。在我看来,* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *依赖性只是链接过程中的问题吗?

谢谢,Mike
Compilation in c generally has four phases
1. Preprocessing
2. Compilation
3. Assembly
4. Linking.

If I use a flag that will not link the code, order of compilation is not an
issue, right? I am not that familiar with compilers so I am not sure. It
seems to me that it would not make a difference as to *which* file was
compiled *when*. Dependencies are only an issue during linking?

Thanks, Mike




唯一的编译依赖是声明。必须在声明之前处理

声明。除了

之外,每个文件都是被视为一个独立的翻译单位。


链接阶段用于解决翻译单元的任何外部参考。

。某些工具在链接之前需要在

中指定的文件作为特殊订单。在创建可执行映像之前必须解决所有外部引用




许多项目将源单元翻译成object

单位。最后阶段包括链接。这些对象

单位形成一个可执行的图像。如果一个对象单元没有被修改,它的源单元将不被翻译,因此

加速构建。但是,有些工具只会从编译单元生成调试器符号。 :-(


-

Thomas Matthews


C ++新闻组欢迎辞:
http://www.slack.net/~shiva/welcome.txt

C ++常见问题: http:// www。 parashift.com/c++-faq-lite

C常见问题: http://www.eskimo.com/~scs/c-faq/top.html

alt.comp.lang.learn .c-c ++ faq:
http:// www.raos.demon.uk/acllc-c++/faq.html

其他网站:
http://www.josuttis.com - C ++ STL图书馆书籍



The only compilation dependencies are the declarations. The
declarations must be processed before the statements. Other than
that, each "file" is treated as an independent translation unit.

The linking phase is used to resolve any external references from
a translation unit. Some tools require the files specified in
a special order before linking. All the external references
must be resolved before creating an executable image.

Many projects will have source units translated into "object"
units. The final phase consists of "linking" these object
units to form an executable image. If an object unit is not
modified, its source unit will not be translated, thus
speeding up the "build". However, some tools will only
produce debugger symbols from compiled units. :-(

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book


周三,2003年12月10日12:18:07 -0600,Michael Gaab

< mi **** @ montana.com>写道comp.lang.c:
On Wed, 10 Dec 2003 12:18:07 -0600, "Michael Gaab"
<mi****@montana.com> wrote in comp.lang.c:
c中的编译一般有四个阶段
1.预处理
2.编译
3.组装
4.链接。

如果我使用的标志不会链接代码,编译顺序不是问题,对吧?我不熟悉编译器,所以我不确定。在我看来,* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *在链接过程中依赖性只是一个问题吗?

谢谢,Mike
Compilation in c generally has four phases
1. Preprocessing
2. Compilation
3. Assembly
4. Linking.

If I use a flag that will not link the code, order of compilation is not an
issue, right? I am not that familiar with compilers so I am not sure. It
seems to me that it would not make a difference as to *which* file was
compiled *when*. Dependencies are only an issue during linking?

Thanks, Mike




实际上C标准专门定义了8个翻译阶段,

但链接确实是最后一个。 C标准中的任何内容都不允许

根据个人翻译的时间或顺序来确定差异

单位通过前7个阶段。


-

Jack Klein

主页: http://JK-Technology.Com

常见问题解答

comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html

comp.lang.c ++ http:// www .parashift.com / c ++ - faq-lite /

alt.comp.lang.learn.c-c ++ ftp://snurse-l.org/pub/acllc-c++/faq



Actually the C standard specifically defines 8 stages of translation,
but linking is indeed the final one. Nothing in the C standard allows
for a difference based on when or in what order individual translation
units pass through the first 7 stages.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq



" Michael Gaab" < MI **** @ montana.com>在消息中写道

新闻:3f ******** @ 127.0.0.1 ...

"Michael Gaab" <mi****@montana.com> wrote in message
news:3f********@127.0.0.1...
c中的编译一般有四个阶段
1。预处理
2.编译
3.组装
4.链接。
Compilation in c generally has four phases
1. Preprocessing
2. Compilation
3. Assembly
4. Linking.




很棒,但是探查器怎么样。那里不是在描述吗?


----- =通过Newsfeeds.Com发布,未经审查的Usenet新闻= -----
http://www.newsfeeds.com - 世界排名第一的新闻组服务!

----- ==超过100,000个新闻组 - 19个不同的服务器! = -----



Great but what about the profiler. Isn''t profiling in there somewhere?

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


这篇关于编译文件依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆