什么是编译和构建德尔福之间的区别? [英] What is the difference between compiling and building in Delphi?

查看:559
本文介绍了什么是编译和构建德尔福之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Delphi-6有两种选择:构建和编译

With Delphi-6 there are two options: Build and Compile.

我知道当我运行只编译已更改的文件,并使用DCUs对于那些还没有计划。当我点击构建显然它重建DCUs。

I know when I run a program it compiles only the files which have changed and uses the DCUs for those which haven't. When I click build apparently it rebuilds the DCUs.

我一直想知道,当我做了释放程序(改变构建设置,条件变量等),可我只是编译,或做我必须做一个完整的构建?

What I have been wondering is, when I make a program for release (changing build settings, conditional variables, etc.) can I just compile, or do I have to do a full build?

如果我不这样做一个完整的生成会发生什么情况,有什么consiquence?

What happens if I don't do a full build, is there any consiquence?

推荐答案

时,生成的,在编制?

编译器才会自动重新编译单元时的.PAS源文件的修改日期时间戳(1,2)。

The compiler only automatically recompiles units when the datetime stamp of the .pas source files changes (1,2).

在项目中的其他状态变化(指令,调试或其他编译器设置等),编译器不会自动重新编译。这时候,你需要强制执行构建。

On other state changes in the project (directives, debug or other compiler settings etc), the compiler won't automatically recompile. That's when you need to force a build.

您还需要强制重建时。公司或其他包含($ I)的文件更改(3),因为他们的日期时间戳记未选中。

You also need to force a rebuild when .inc or other included ($I) files change(3), since their datetime-stamp is not checked.

因此​​,在总结的时候什么,但单位.PAS文件的更改,你需要做一个构建。

So in summary, when anything but the unit .pas files changes, you need to do a build.

有一些奇怪的情况下,在建设。大多数结果在而出现找不到单元XXX错误在那里

There are some strange cases in building. Most result in a "can't find unit xxx" error while it appears to be there


  1. 一个是时,在项目单位的路径是错误的,或在工作目录是错误的使用相对路径。 (见<一href=\"http://stackoverflow.com/questions/2603077/delphi-debug-a-wrong-unit/2603410#2603410\">http://stackoverflow.com/questions/2603077/delphi-debug-a-wrong-unit/2603410#2603410 )

  2. (我不完全知道这一个,这是一个假设)一个.dcu是因为的CRC(1)的重新编译,但新编译DCU被放置在不同的目录。这是不适合当前的编译的一个问题(因为正确DCU已经装载),但在随后的编译(例如取决于封装)旧DCU文件再被发现,并且源不 - >错误。 有疑问的情况下,总是通过递归删除所有DCU的
  3. 清洁您的构建迪尔斯
  1. one is when the path of the unit in the project is wrong, or uses a relative path while the working directory is wrong. (see http://stackoverflow.com/questions/2603077/delphi-debug-a-wrong-unit/2603410#2603410 )
  2. (I'm not entirely sure about this one, it is a hypothesis) a .dcu is recompiled because of the CRCs (1), but the newly compiled dcu is placed in a different directory. This is not a problem for the current compile (since the correct dcu is already loaded), but in a subsequent compile (e.g. a dependant package) the old dcu file is found again, and the source not -> error. in case of doubt always clean your build dirs by recursively deleting all DCU's

(1),并且如果Delphi是像FPC,.dcu的包含所有DCU的的接口部分的CRC这取决于。这可用于检查是否存在用于重新编译一个额外的需求了。例如。由于文件系统的操作(移动DCU的约)

(1) and if Delphi is like FPC, .dcu's contain a CRC of the interface section of all dcu's it depends on. This can be used to check if there is an additional need for recompiles too. E.g. due to filesystem manipulation (moving dcu's about)

(2)专家,看看{$ implicitbuild XX}太

(2) for the experts, have a look at {$implicitbuild xx} too

(3)违背了德尔福,FPC并重建上。公司的变化。该FPC项目大量使用.inc文件在内部,这种变化已经从之前有德尔福的支持日期。
其结果是,该限定增量文件拷贝到任意目录包将不与FPC的编译,因为它们具有通常略微不同的尺寸和CRC。印地(10)就是一个很好的例子。

(3) contrary to Delp FPC does rebuild on .inc changes. The FPC project heavily uses .inc files internally, this change already dates from before there was Delphi support. As a result, packages that copy the "defines" inc file into any directory won't compile with FPC because they have usually slightly different size and CRC. Indy (10) is a good example of this.

这篇关于什么是编译和构建德尔福之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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