永不编译的软件包[xxx]必须重新编译/违反共享规定[Delphi文档问题] [英] Never-build package [xxx] must be recompiled / SHARING VIOLATION [Delphi documentation issue]

查看:115
本文介绍了永不编译的软件包[xxx]必须重新编译/违反共享规定[Delphi文档问题]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚升级到Delphi XE7。现在,在XE中完全符合要求的软件包不再可以编译。

I just upgraded to Delphi XE7. Now a package that complied perfectly in XE doesn't compile anymore.

我拥有的B软件包要求将AmplicitBuild设置为OFF的A软件包。
首先,我编译并安装了程序包A。然后我尝试编译程序包B,但编译器说:

I have package B that requires package A that has ImplicitBuild set to OFF. First thing first, I compiled and installed package A. Then I tried to compile package B but the compiler says:


[ dcc32致命错误] A.dpk(39):E2225永不编译的软件包'A'必须
重新编译。

[dcc32 Fatal Error] A.dpk(39): E2225 Never-build package 'A' must be recompiled.

[dcc32致命错误] B.dpk (34):E2202找不到必需的程序包'A'。

[dcc32 Fatal Error] B.dpk(34): E2202 Required package 'A' not found.

很明显,找到了程序包A,因为编译器知道其内容了(它知道ImplicitBuild设置为OFF)。
另外,很明显,我在库路径中添加了程序包A的路径。

Obviously, package A was found since the compiler knows its content (it know that the ImplicitBuild is set to OFF). Also, obviously, I added the path for package A in 'Library path'.

如果我从程序包A中删除了ImplicitBuild指令,则编译器只会说:

If I remove the ImplicitBuild directive from package A, the compiler simply says:


'未找到所需的软件包'A'。

'Required package 'A' not found.'

过程监视器显示了一个有趣的条目:

Process Monitor shows an interesting entry:


C:\Users\trei \文档\Embarcadero\Studio\15.0\导入\A.dcp<-未找到路径

C:\用户\公共\文档\Embarcadero\Studio\15.0\Bpl\A.bpl<-
共享违规

C:\Users\Public\Documents\Embarcadero\Studio\15.0\Bpl\A.bpl <-- SHARING VIOLATION

'C:\Users\trei\Documents\Embarcadero\Studio\'中没有'15 .0'文件夹。

There is no '15.0' folder in 'C:\Users\trei\Documents\Embarcadero\Studio\'.


  1. 为什么找不到A.dpk文件?

  2. 为什么Delphi想要重新编译还是要打包吗?

  3. Delphi为什么要搜索导入文件夹中的DCP文件? DCP存储在'c:\Users\Public\Documents\Embarcadero\Studio\15.0\Dcp\A.dcp'






有趣的事实:

与此消息​​相关的错误(错误#109584),但在XE4中被标记为已修复。
http://qc.embarcadero.com/wc/qcmain.aspx ?d = 109584

回归?


Interesting fact:
There was a bug related to this message (bug #109584) but it was marked as fixed in XE4. http://qc.embarcadero.com/wc/qcmain.aspx?d=109584
Regression?

推荐答案

PATH env变量必须包含bpl文件夹。安装程序通常会为您添加此文件夹。如果不是这种情况,则Delphi将找不到bpl,因为bpl是作为dll加载的。 LoadLibrary 不在乎Package输出目录。但是path变量的大小有限制。因此,这可以解释为什么在全新的Delphi安装中会缺少此功能。

The PATH env variable must include the bpl folder. The setup usually adds this folder for you. If that is not the case, then Delphi will not find the bpls, because they are loaded as a dll. LoadLibrary does not care about the Package output directory. But there is a limit on the size of the path variable. So this can explain why this is missing in your brand new Delphi installation.

在最新版本的Delphi中,您可以转到工具->选项->环境变量并添加 path 用户替代而不是修改环境路径:
C:\Users\Public\Documents\Embarcadero\ Studio\15.0\Bpl; C:\Program Files(x86)\Embarcadero\Studio\15.0\bin; C:\Program Files(x86)\Embarcadero\Studio\15.0\ bin64; C:\用户\公共\文档\Embarcadero\Studio\15.0\Bpl\Win64; C:\用户\公共\文档\Embarcadero\InterBase\redist\ BaseInterBaseXE3\win32_togo; C:\用户\公共\文档\Embarcadero\InterBase\redist\InterBaseXE3\win64_togo; $(PATH)

In recent versions of Delp you can go to Tools -> Options -> Environment Variables and add a path user override instead of modifying the env path: C:\Users\Public\Documents\Embarcadero\Studio\15.0\Bpl;C:\Program Files (x86)\Embarcadero\Studio\15.0\bin;C:\Program Files (x86)\Embarcadero\Studio\15.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\15.0\Bpl\Win64;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBaseXE3\win32_togo;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBaseXE3\win64_togo;$(PATH)

最后的$(PATH)用作全局PATH env变量的占位符。

The $(PATH) at the end is used as a placeholder for the global PATH env var.

PATH env var,尤其是如果您安装了许多版本的Delphi。

This reduces the size of the PATH env var, especially if you have many versions of Delphi installed.

这篇关于永不编译的软件包[xxx]必须重新编译/违反共享规定[Delphi文档问题]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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