我正在将我的代码从Delphi 2007移到XE7。 我的程序使用后期绑定包方式。 所以我用“链接运行时包”选项编译我的应用程序。 2007年我用这种方式很长一段时间。
但在XE7中,相同的包结构,原因:
“单元X使用不同版本的Y.Txyz编译”错误消息。
单位X在我的一个包裹中。 Y单元也在库包中。 关系似乎没问题。 为什么XE7会出现此错误? 我尝试了以下方法:
我清除了.dcu文件。 我在包中打开Build as Needed选项。 构建所有包和应用程序文件。编译器传递一些错误,但重复“..编译与不同的版本..”类型错误在其他地方..
我不清楚这个问题。 XE7的逻辑有变化吗? 最好的祝福
I am moving my code from Delphi 2007 to XE7. My program use late binding package way. So I compile my application with "link with runtime packages" options. I used this way for a long time with 2007.
But in XE7, same package structure, cause:
"Unit X was compiled with different version of Y.Txyz" error message.
Unit X in one of my package. Y unit is in a library package also. Relation seems ok. Why XE7 gives this error? I tried following ways:
I cleared .dcu files. I open Build as Needed option in packages. Build All every package and application files.Compiler pass some errors but repeat ".. compiled with different version .." type error somewhere else..
I am not clear about this issue. Is there changing in logic of XE7? Best Regards
最满意答案
我专注于这个问题,我从Delphi2007中实现了一些不同的XE7。
编译器搜索* .dcu文件。 如果以某种方式生成多个版本的* .dcu文件,则其中一个包可以生成“使用不同版本编译的单元”错误。
如果源包声明为“Rebuild as Needed”,则在使用源包编译其他包时,再次编译单元并生成新的dcu文件。 所以,相反,检查“显式重建”。
我创建了常见的dcu路径,并在“单元输出目录”中为所有包声明。
I focused on the problem and I realised some differencies XE7 from Delphi2007.
Compiler search for *.dcu files. If there is more than one version of *.dcu files produced somehow, than one of the package can produce "unit compiled with different version" error.
If source package declared as "Rebuild as Needed", when compilingg other packages using source package, compile units again and produce new dcu files. So, Instead, check "Explicit Rebuild".
I created common dcu path and declared in "unit output directory" for all packages.
更多推荐
发布评论