如何正确设置“目录/条件”和“库”路径 [英] How to correctly set "Directories/Conditionals" and "Library" path

查看:167
本文介绍了如何正确设置“目录/条件”和“库”路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在环境选项中的项目选项和库路径中设置目录/条件?德尔福帮助不要太多关于这些非常重要的设置。我有一些奇怪的错误,因为我的VCL之间的依赖关系错误。

How to set "Directories/Conditionals" in Project Options and "Library" path in Environment Options? Delphi help don't say much about these very important settings. I have all kind of strange errors because of wrong dependencies between my VCLs.

1。

我已将一大组第三方控件合并到名为ThirdPartyPackages_D7.dpk的包中。当我重新安装Delphi时,这是非常有用的,因为我不必每次重新安装所有这些第三方VCL。

I have merged a large set of 3rd party controls in a package called ThirdPartyPackages_D7.dpk. This is useful when I reinstall Delphi because I don't have to reinstall all those 3rd party VCLs amnually.

然后,我的MyControls_D7.dpk中有我自己的控件,这取决于ThirdPartyPackages VCL。我还有另一个包,依赖于MyControls的BlgPackage.dpk。

Then, I have my own controls in MyControls_D7.dpk which depends on the ThirdPartyPackages VCL. I also have another package BlgPackage.dpk that depends on MyControls.

在链结尾是我的应用程序(DPR项目),它使用BlgPackage中的控件。

At the end of the chain is my application (DPR project) which is using the controls in BlgPackage.

ThirdPartyPackages.dpk -> MyControls.dpk -> BlgPackage.dpk -> MyApplication.dpr

当我更改/编辑第二个包(MyControls.dpk)并构建DPR应用,它的工作。编译器会看到对该包所做的更改。
但是,如果我关闭项目并加载和编译BlgPackage,它会抛出一个令人讨厌的消息,在MyControls中找不到函数xyz,因为我删除它(我将MyControls的单元与应用程序的单元并行地加载到IDE中) 。似乎构建应用程序只刷新所有使用的程序包的DCU文件,但不刷新DCP / BLP文件。

When I change/edit something to the second package (MyControls.dpk) and build the DPR application, it works. The compiler sees the changes made into that package. However, if I close the project and load and compile the BlgPackage, it throws a nasty message that function xyz cannot be found in MyControls because I delete it (I have loaded MyControls' units into IDE in parallel with application's units). It seems that building the application only refreshes the DCU files for all used packages but not the DCP/BLP files.

如何在软件包中编写和编译代码,而不会将软件包显式加载到IDE中并构建它们?
(注意:我有一个令人讨厌的错误,不允许我在不重新启动IDE的情况下切换项目,或者同时加载一组项目/包(* .bpg)。)

How do I write and compile the code in the packages without explicitly loading the packages into the IDE and building them? (Note: I have a nasty bug that does not allow me to switch between projects without restarting the IDE or to load a group of projects/packages (*.bpg) at the same time.)

2。

另一个问题是我想将程序包的编译文件(DCP / BPL / DCU)存储在其中文件夹(例如c:\MyProjects\Blg)。

如果我将BlgPackage包的输出目录,单位输出目录和DCP输出目录只有其BPL / DCU / DCP文件将存储在那里,而MyControls的BPL / DCP文件也将存储在那里。
如何将每个包的二进制文件放在一个单独的文件夹中?

Another problem is that I want to store the compiled files (DCP/BPL/DCU) of a package in its folder (for example c:\MyProjects\Blg).
If I set the "Output directory", "Unit output directory" and "DCP output directory" boxes of BlgPackage package to its folder, not only its BPL/DCU/DCP files will be stored there but also the BPL/DCP files of MyControls will be stored there. How can I have the binary files of each package in a separate folder?

Delphi 7,Win XP ,所有项目设置为根据需要重建

Delphi 7, Win XP, all projects set to "Rebuild as needed"

推荐答案

我的解决方案(有点脏,但是它的工作原理):

MY solution (kinda dirty, but hey it works):

我把所有第三方libraries.controls放在一个包中(超级包)。我把所有的控件放在一个包中。

I put ALL 3rd party libraries.controls in a single package (a super-package). I put all my controls in a single package.

现在,当我将包迁移到其他PC时,我只需要复制/粘贴两个文件夹并设置两条路线。

Now, when I migrate the packages to a different PC all I have to do is to copy/paste two folders and set two paths.

为我工作 - 其他人可能不同意,我不能怪他们。我责怪Borland / Embarcadero的地狱设计师。如果你看StackOverflow,你会看到,直到现在还没有人提供一个优雅的解决方案。

Works for me - others may not agree with it and I can't blame them. I blame the 'hell designers' from Borland/Embarcadero. If you look on StackOverflow you will see that until now nobody provided an elegant solution to this.

这篇关于如何正确设置“目录/条件”和“库”路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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