“无法加载包 A,它包含单元 X,它也包含在包 B 中" [英] "Cannot load package A, it contains unit X, which is also contained in package B"

查看:19
本文介绍了“无法加载包 A,它包含单元 X,它也包含在包 B 中"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(对我来说更多的包/组件安装乐趣——感谢大家迄今为止的所有帮助).

(More package/component install fun for me -- thanks everyone for all your help to date).

我在 Delphi 2007 中将错误列为标题.包 A 是我的基于框架的查看器面板"包.包 B 是一个包含几个组件的包,这些组件用于显示有关链接到 gven 数据库的数据集的信息(它们的 SQL、状态、类类型等),其中一个是非可视组件(我们称之为检查员)创建并调用显示该信息的表单.单位 X 是该表格的单位.

I am getting the error listed as the title, in Delphi 2007. Package A is my package of frame-based "viewer panels." Package B is a package containing a couple of components that are used to show information about datasets linked to a gven database (their SQL, state, class type, etc), one of which is a non-visual component (we'll call it the Inspector) which creates and calls a form showing that information. Unit X is the unit of that form.

我将 Inspector 组件添加到 Package 中的一个查看器面板中,但已将其删除,并且在该项目的 View Source 中找不到对它的任何引用,也无法在我添加的基于框架的查看器面板的单元中找到它到.引用隐藏在哪里?

I added the Inspector component to one of my viewer panels in Package, but have since deleted it, and cannot find any reference to it in View Source for the project, nor in the unit of the frame-based viewer panel I added it to. Where is the reference hiding?

此外,将 Inspector 组件添加到其中一个视图面板框架(也作为注册组件安装)会导致此问题吗?

Also, what would make adding that Inspector component to one of the view panel frames (which also get installed as registered components), cause this problem?

这可能与 this previous问题这个也是如此,但我决定重新开始这个特定的症状/问题,只是为了保持简洁明了,希望以后对其他人有用.提前感谢您的任何帮助.

This is likely related to this previous question and this one as well, but I decided to start fresh with this specific symtpom / issue, just to keep it succinct and clear, and hopefully thus useful to someone else later. Thanks in advance for any and all help.

更新:

感谢 Loren,我能够找到并删除保留并导致问题的 USES 引用.但是,我仍然不清楚如何完成我想要完成的事情.: 这是最新的:

Thanks to Loren, I was able to find and remove the USES reference that remained and was causing the problem. HOWEVER, I'm still not clear on how to accomplish what I'm trying to accomplish. : Here's the latest:

Inspector 是一个简单的非可视组件,它包含一个 DataSet 属性和一个内部信息表单".调用 ShowInfo 方法会创建表单,并使用与链接的 DataSet 相关的各种信息填充它.我想用它来调试驱动查看器的 SQL.

The Inspector is a simple non-visual component which contains a DataSet property, and an internal "Info Form." Calling a ShowInfo method creates the form, and populates it with various information related to the linked DataSet. I'm wanting to used it to debug the SQL driving the viewers.

如上所述,Inspector 包含在包 B 中.查看器在包 A 中.我想在一些 TFrame 后代(注册为真正的调色板组件)上使用 Inspector 组件.当我将该组件放在给定的 TFrame 上以使用它并编译/安装包 A 时,我收到无法加载包 A,它包含单元 X,它也包含在包 B 中"错误.现在很明显是原因所在,我可以按需重新创建问题.

As mentioned above, the Inspector is contained in Package B. The viewers are in Package A. I want to use the Inspector component on some of the TFrame descendents (which register as true palette components). When I drop that component on the given TFrame however to use it, and compile/install Package A, I get the "Cannot load package A, it contains unit X, which is also contained in package B" error. It's now clearly the cause, and I can re-create the problem on demand.

moobaa 的以下建议是有道理的,但 似乎 即使我尝试按照他的建议执行方法 #2,它也不起作用.我错过了什么?看起来这应该是可行的,事实上,我见过的大多数软件包似乎一直在使用其他已安装的软件包(包括 VCL 本身).

moobaa's suggestion below makes sense, and yet it seems that even though I am trying to do approach #2 of what he suggest, it does not work. What am I missing? It seems like this should be doable, and in fact it seems like most packages I've seen use other installed packages all the time (included the VCL itself).

注意:据我所知,包 B 不依赖于包 A(而且我已经单独安装了它,所以这似乎同意).

Note: Package B does not depend on Package A, as far as I can tell (and I've installed it stand alone, so that seems to agree).

(顺便说一句,是否有任何工具可以像这样绘制"包依赖关系?我使用的是 D2007)

(BTW, are there any tools to "chart out" package dependencies like this? I'm using D2007)

一如既往,感谢您的时间和帮助.

As always, thanks for your time and help.

推荐答案

仅仅因为你删除了组件并不意味着你从USES子句中删除了模块名称——这些不是自动删除的.

Just because you deleted the component doesn't mean you deleted the module name from the USES clause--those aren't auto-deleted.

这篇关于“无法加载包 A,它包含单元 X,它也包含在包 B 中"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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