简体   繁体   English

在Delphi 6 Professional IDE中使用DCC32编译项目

[英]Compiling projects with DCC32 as in Delphi 6 professional IDE

IDE: Delphi 6 Professional. IDE:Delphi 6专业版。

We have big projects. 我们有大项目。

I cannot use Project Groups to build them all, because I got OM errors, and strange file errors when I did it. 我无法使用项目组来全部构建它们,因为这样做时会遇到OM错误和奇怪的文件错误。

My idea was that I will use DCC32.exe Priorly I had a fight with the command line parameters (dcc32.cfg), but it I thought I solved it... 我的想法是,我将使用DCC32.exe以前我曾与命令行参数(dcc32.cfg)进行过较量,但我认为我已解决了它。

Today I tried to compile projects with it, but at first project I got errors. 今天,我尝试使用它来编译项目,但是在最初的项目中我遇到了错误。

chdir c:\\d\\anyproject dcc32 -b any.dpr chdir c:\\ d \\ anyproject dcc32 -b any.dpr

The error reported me that it wasn't found a unit. 错误报告我找不到单位。 I tried to compile in Delphi, and it was successful. 我尝试在Delphi中进行编译,并且成功。

So I checked the problem. 所以我检查了问题。 Why the previous project buildings were successful, and why this wasn't...? 为什么以前的项目建筑成功,为什么不成功?

Then I realized that this dpr is using references to a subdirectory, but not all files added to the project, more of them are linked by project's "search path". 然后,我意识到该dpr使用的是对子目录的引用,但并不是所有添加到项目中的文件,更多的文件是通过项目的“搜索路径”链接的。

But if it's true, then this meaning that DCC32 ISN'T USING THE PROJECT'S DOF/CFG FILES! 但是,如果这是真的,那么这意味着DCC32不会使用项目的DOF / CFG文件!

So the problem is that Delphi merges everything to provide the result. 因此,问题在于Delphi合并了所有内容以提供结果。 It merges the global search paths, the project's compiler directives, the searching paths, so everything, and using the project's conditional directives too. 它合并了全局搜索路径,项目的编译器指令,搜索路径,以及所有内容,还使用了项目的条件指令。

If I understand it well, the DCC32 don't use, only the dcc32.cfg, and I must merge everything for the compilation, what is an impossible job, because I need to write a parser what is interprets the project's parameters, and merges with globals. 如果我理解得很清楚,那么DCC32就不会使用,只会使用dcc32.cfg,而且我必须合并所有内容进行编译,这是不可能完成的工作,因为我需要编写一个解析器来解释项目的参数并合并与全球人士。

Or I misunderstand something, and the problem is caused by other thing what I missed? 还是我误会了某件事,而问题又是由我错过的另一件事引起的?

I waiting for your suggestions! 我等待您的建议!

Thanks for all idea, link, info, etc. 感谢您提供的所有想法,链接,信息等。

dcc32 options from the following places: dcc32选项来自以下位置:

  1. A dcc32.cfg file. dcc32.cfg文件。 This can be either in the current directory, or the same directory as dcc32.exe. 该目录可以在当前目录中,也可以与dcc32.exe位于同一目录中。
  2. The command line. 命令行。
  3. The source code. 源代码。

I have order these in order of increasing precedence. 我按优先级从高到低的顺序排列这些。 So, an option specified in source code always overrides settings made a dcc32.cfg file, or on the command line. 因此,在源代码中指定的选项始终会覆盖dcc32.cfg文件或命令行中的设置。

dcc32.exe will choose whichever dcc32.cfg file it finds first. dcc32.exe将选择它首先找到的dcc32.cfg文件。 It looks in the current directory first. 它首先在当前目录中查找。

What all this means is that you are responsible for getting the settings from the .dof file, and from the IDE into your command line compilation environment. 这意味着您有责任从.dof文件以及从IDE获取设置到命令行编译环境。

This is one of the many reasons why you should upgrade. 这是您应该升级的众多原因之一。 Modern Delphi versions use msbuild for command line compilation and make it trivially easy to be sure that your command line builds are the same as IDE builds. 现代的Delphi版本使用msbuild进行命令行编译,并使其非常容易地确保您的命令行生成与IDE生成相同。

When you watch an msbuild in progress you will see that it results in a call to dcc32.exe with all options specified on the command line. 当您查看正在进行的msbuild时,您会看到它导致对dcc32.exe的调用,并在命令行上指定了所有选项。 Transforming the project settings into a call to dcc32.exe is what you are now faced with. 您现在面临的是将项目设置转换为对dcc32.exe的调用。 In Delphi 6 you have to do that yourself. 在Delphi 6中,您必须自己做。 In modern Delphi, the tools are part of the product. 在现代的Delphi中,这些工具是产品的一部分。

This might help: 这可能会有所帮助:

http://delphi.wikia.com/wiki/Compile_from_Commandline http://delphi.wikia.com/wiki/Compile_from_Commandline

It describes how to do commanline compiles with Delphi versions from Delphi 1 to XE3 and also links to the tool dof2cfg which you might find helpful. 它描述了如何使用从Delphi 1到XE3的Delphi版本进行命令行编译,并链接到可能会有所帮助的工具dof2cfg。

IIRC the command line compiler always uses a configuration file named dcc32.cfg found either in the current folder or where dcc32.exe resides. IIRC命令行编译器始终使用在当前文件夹或dcc32.exe所在的位置中找到的名为dcc32.cfg的配置文件。 You may try to rename or copy your .cfg file to dcc32.cfg and see if that solves your problem. 您可以尝试将.cfg文件重命名或复制到dcc32.cfg,看看是否可以解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 IDE 中使用 DCC32 进行编译 - How to compile with DCC32 as in the IDE 使用“ dcc32 -JL”进行编译时,从另一个包中的另一个单元访问Delphi方法指针 - Accessing Delphi method pointers from another unit in another package when compiling with 'dcc32 -JL' Delphi 7 DCC32如何指定.exe名称? - Delphi 7 DCC32 How to specify .exe name? 使用 DCC32 的 Delphi 10.3 编译具有旧的 Delphi 5 视觉风格 - Delphi 10.3 compilations using DCC32 have the old Delphi 5 visual style IDE编译成功,但dcc32写道:错误:E2010不兼容类型:'Integer'和'NativeInt' - IDE compiles successfully, but dcc32 writes: Error: E2010 Incompatible types: 'Integer' and 'NativeInt' 我怎样才能让 MSBuild 完全构建一个相当于 dcc32 -b 的 Delphi 项目? - How can I get MSBuild to do a full build of a Delphi project equivalent to dcc32 -b? dcc32:* .cfg中的环境变量 - dcc32: environment variables in *.cfg Delphi XE3:[dcc32致命错误] Unit5.pas(7):F1026找不到文件:“ RzEdit.dcu” - Delphi XE3: [dcc32 Fatal Error] Unit5.pas(7): F1026 File not found: 'RzEdit.dcu' 是否有DCC32选项将特定编译器警告视为错误? - Is there a DCC32 option to treat a specific compiler warning as an error? 有没有办法关闭MSBuild调用的DCC32中的安静模式? - Is there a way to turn off the quiet mode in DCC32 called by MSBuild?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM