写了一个包ExLibX2,在编译时提示必须加入 adortl.dcp 如图:新建一个工程,拖一个ExLib中的任意一控件到窗体上,设置Options-Runtime Packages =True
F9运行,提示如下错误:
E2199 Packages 'adortl' and 'ExlibX2' both contain unit 'Data.Win.ADODB'
E2199 Packages 'adortl' and 'ExlibX2' both contain unit 'Data.Win.ADOConst'如下图:

解决方案 »

  1.   

    原文:
    E2199: Packages '%s' and '%s' both contain unit '%s' (Delphi)
    The project you are trying to compile is using two packages which both contain the same unit. It is illegal to have two packages which are used in the same project containing the same unit since this would cause an ambiguity for the compiler. A main cause of this problem is a poorly defined package set. The only solution to this problem is to redesign your package hierarchy to remove the ambiguity.翻译:
    您尝试编译该项目使用的是两个包都包含相同的单位。这是非法的,有两个包包含同一单位在同一项目中所使用的编译器,因为这会引起歧义。 这个问题的一个主要原因是不良的定义的程序包集。 这个问题,唯一的解决办法是重新设计包的层次结构中删除的模糊性。SO,你的包的设计有问题。
      

  2.   

    bpl本来就是这种模式。
    我估计你不小心改掉原本adortl了吧。
    尝试在一个全新的环境下再试试。
      

  3.   

    包'adortl'和'ExlibX2'都包含了单元'Data.Win.ADODB'
      

  4.   

    包ExlibX2 用到了ADO,但是却没有引入 adortl , 导致 ExlibX2 adortl 两个包不能共存,无论是设计期或运行期都是如此。