gpt4 book ai didi

delphi - 为什么 Delphi 没有在正确的文件夹中输出 DCU 文件?

转载 作者:行者123 更新时间:2023-12-03 15:19:56 26 4
gpt4 key购买 nike

我有一个项目 (C:\Test\Test.dpr),它使用属于库 (MyLib.DPK) 的文件 (External.pas)。库中的所有文件都可以通过“搜索”路径访问,但我还将External.pas直接包含在我的DPR文件中:

program Test;

uses
External in '..\Packages\MyLib\External.pas', <------ the 'external' file
FormMain in 'FormMain.pas' {frmMain};

对于这个项目,我将“输出目录”和“输出 DCU 目录”设置为“.\$(Platform)_$(Config)”。

当我编译时,该项目的所有DCU的exe文件都写入正确的输出文件夹中:c:\Test\Win64_Debug\

但是,External.dcu 是在 ..\Packages\MyLib\External.dcu
中生成的而不是 c:\Test\Win64_Debug\

这是为什么?

<小时/>

让我以不同的方式问这个问题:如果我向 DPR 项目附加位于不同文件夹中的 PAS 文件,那么所有 DCU 文件(包括外部文件)是否都不应在与该项目相同的文件夹中生成EXE 文件?

最佳答案

来自documentation :

Output directory

Specifies where the compiler should put the executable file.

Unit output directory

Specifies a separate directory to contain the compiled units (.dcu).

听起来您需要指定单元输出目录以及输出目录。我个人倾向于将这两个目录分开。

关于delphi - 为什么 Delphi 没有在正确的文件夹中输出 DCU 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33199710/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com