简体   繁体   English

如何保留多个Delphi版本的编译代码?

[英]How do I keep compiled code for multiple Delphi versions?

I have a Delphi code library that I want to put in a central directory, say: 我有一个Delphi代码库,我想放在一个中央目录中,例如:

C:\\delphi\\codelibs\\fastMM C:\\ delphi \\ codelibs \\ fastMM

I have 5/7/2009 versions of Delphi installed. 我已经安装了5/7/2009版本的Delphi。 Now, I want to use the library from all these Delphi versions without the .dcu file conflicts . 现在, 我想使用所有这些Delphi版本中的库,而没有.dcu文件冲突 (Each delphi versions compile to slightly different .dcu files, you know that!) (每个delphi版本都编译为稍有不同的.dcu文件,您知道的!)

Also each compiled .dcu files should be in directories like : 另外,每个已编译的.dcu文件都应位于以下目录中:

C:\\delphi\\codelibs\\libs\\D5 C:\\ delphi \\ codelibs \\ libs \\ D5

C:\\delphi\\codelibs\\libs\\D7 C:\\ delphi \\ codelibs \\ libs \\ D7

C:\\delphi\\codelibs\\libs\\D2009 C:\\ delphi \\ codelibs \\ libs \\ D2009

How can I add these dirs to delphi browsing path? 如何将这些目录添加到delphi浏览路径?

The directory with the source code should appear in the browsing path . 带有源代码的目录应出现在浏览路径中 The directory with the compiled code should appear in the search path and the library path . 带有已编译代码的目录应出现在搜索路径库路径中 (If you include source code in the search path, then Delphi might recompile it, even when it doesn't really need recompiling, and that can lead to even more unnecessary compilation. Keep as little code as possible in the search path. My search path typically has no source code .) (如果在搜索路径中包含源代码,则即使确实不需要重新编译,Delphi也可能会重新编译它,这可能导致不必要的编译。在搜索路径中保留尽可能少的代码。我的搜索path通常没有源代码 。)

Delphi can put the DCU files in the correct directory for you. Delphi可以将DCU文件放置在正确的目录中。 Open the package project for the library and configure the unit output directory to be the version-specific folder you've chosen. 打开库的软件包项目,并将单元输出目录配置为您选择的特定于版本的文件夹。

The BPL files generated from the packages will not need to be put into separate directories because they will simply take the names of their corresponding DPK files, and those files should already have version-specific names. 从软件包生成的BPL文件将不需要放在单独的目录中,因为它们仅使用其相应DPK文件的名称,并且这些文件应该已经具有版本特定的名称。 If they don't, then you can specify a suffix for Delphi to apply to the binaries' names. 如果没有,则可以为Delphi指定后缀以应用于二进制文件的名称。

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

相关问题 如何看待编译的Delphi代码? - How to look at compiled Delphi Code? 如何使我的Delphi代码与多个平台兼容? - How do I make my Delphi code compatible with multiple platforms? 如何确定单元是否已编译为Delphi程序? - How do I determine if a unit has been compiled into a Delphi program? 在Delphi 7中,如何跟踪编译单元的顺序? - In Delphi 7, how do I trace the order in which the units are being compiled? 如何防止Delphi自动扩展折叠的代码区域? - How do I keep Delphi from automatically expanding folded code regions? 如何在旧的Delphi版本中编译记录的Delphi代码(&lt;2005) - How I can compile documented Delphi code in older Delphi versions (<2005) 如何在jenkins节点上设置多个delphi版本? - How to setup multiple delphi versions on jenkins node? MSBuild和多个Delphi版本 - MSBuild and multiple Delphi versions 如何在适用于多个平台的Delphi XE7应用程序中处理特定于平台的代码? - How do I handle platform specific code in a Delphi XE7 app meant for multiple platforms? 在比较Delphi表单文件的版本时,如何使Beyond Compare忽略某些差异 - How do I make Beyond Compare ignore certain differences while comparing versions of Delphi Form Files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM