使用XE6在我的Delphi 5文件中找不到绝地 [英] Cannot find jedi within my Delphi 5 file using XE6

查看:68
本文介绍了使用XE6在我的Delphi 5文件中找不到绝地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Delphi5中创建的多文件项目,并且我试图在Delphi XE6中进行编译.

在我的DSPack.pas文件中,出现错误:与代码行有关的找不到'jedi.inc'..."

  {$ I jedi.inc} 

...还有很多错误,大多数都是未声明的标识符",错误显示为错误-但被命名为初始错误,我认为这是因为编译器找不到jedi.inc文件...

我在我的Comps文件夹中找到了jedi文件-jcl-.

我的问题有三点:

一个:为什么XE6没有注册jedi.inc,而在Delphi 5中却注册了?

二:绝地文件通常位于哪里?

我相信我已经下载了jcl文件(jcl-2.6.0.5178)的更新版本.

三:我需要在我的项目中做什么,以便编译器找到jedi.inc文件?

解决方案

我想您知道可以通过在D5..XE6 IDE中单击将文件添加到项目"按钮将.Pas添加到项目中.您也可以使用.Inc文件.但是...

对.Pas文件执行此操作时,可以在项目管理器"弹出窗口中看到该文件已记录了该文件的路径,这足以使编译器能够找到它.但是,由于某些原因,.Inc文件的情况不是.这显然是设计使然,因为这种差异至少早在D5 IIRC之前就已存在.TBH,我不确定为什么,因为好几次我看到如果编译器能够从项目经理显然知道其位置的情况下找到一个.Inc文件,本来可以避免的问题.因此,我无法回答您的为什么?"查询,尽管我敢说编译器设计者可以.

要使编译器能够找到.Inc文件,您有两种选择来处理"how"查询(除了移动.Inc文件外,对于像JCL/一样大而复杂的东西)JVCL可能不是一个好主意):

  • 在{$ I}指令中包括.Inc文件的路径.就我而言,JCL内容位于Jedi文件夹下的两个文件夹中,而Jedi文件夹本身位于D:驱动器上的Delphi目录下,因此我将"{$ I ...}"行写为

{$ ID:\ Delphi \ Jedi \ JCL \ Source \ Include \ Jedi.Inc}

  • 将.Inc文件的路径添加到下面的路径列表中

Project | Options \ Delphi编译器|搜索路径.这些方法中的第一种可能是更可取的,因为它仅涉及.Inc文件,而第二种则告诉编译器在该路径中查找尚未找到的任何内容,这并不总是可取的.

关于您的位置"点,正如您从其中一条注释中所收集的那样,JEDI/JVCL发行版中Jedi.Inc文件的位置似乎早已移至其位置.现在,我想这就是为什么您在使用D5下可以编译的东西时遇到这个问题的原因.

I have a multi-file project that was created in Delphi5 and I am attempting to compile in Delphi XE6.

In my DSPack.pas file I get the error: "'jedi.inc' could not be found..." related to the code line:

{$I jedi.inc} 

... there are also many, mostly "undeclared identifier", errors shown as errors - but named as initial errors, which I presume are because the compiler can't find the jedi.inc file...

I have located the jedi file - jcl- in my Comps folder.

My question is three-fold:

One: Why does XE6 not register jedi.inc whereas it did in Delphi 5?

Two: Where is jedi file usually located?

I believe I have downloaded an updated version of jcl file (jcl-2.6.0.5178).

Three: What do I need to do in my project so that the compiler and find the jedi.inc file?

解决方案

I imagine you're aware that you can add a .Pas to a project by clicking the Add File to Project button in the D5..XE6 IDE. You can do likewise with an .Inc file. However ...

When you do that for a .Pas file, you can see in the Project Manager pop-up that it has recorded the path to it, and this is sufficient for the compiler to be able to find it. But, for some reason, the same is not the case for an .Inc file. This evidently by design, because this difference has existed at least as far back as D5, IIRC. TBH, I'm not sure why, because several times I've seen problems that would have been avoided if the compiler had been able to find an .Inc file from what the Project Manager obviously knows about its location. So, I can't answer your "why?" query, though I dare say the compiler designers could.

To enable the compiler to find an .Inc file, you have two alternatives to deal with your "how" query (apart from moving the .Inc file, which in the case of a thing as large and complex as the JCL/JVCL is probably not such a good idea):

  • Include the path to the .Inc file in the {$I } directive. In my case, the JCL stuff is located two folders below a Jedi folder which is itself below a Delphi directory on my D: drive, so I would write the "{$I ...}" line as

{$I D:\Delphi\Jedi\JCL\Source\Include\Jedi.Inc}

  • Add the path to the .Inc file to the list of paths under

Project|Options\Delphi compiler|Search path. The first of these methods is probably preferable, because it only involves the .Inc file, whereas the second tells the compiler to look in that path for anything it hasn't already found, which may not always be desirable.

As to your "where" point, as you may have gathered from one of the comments, the location of the Jedi.Inc file(s) in the JCL/JVCL distribution seems to have been moved since olden days to where it is now, which I think is why you're having this problem with something which used to compile under D5.

这篇关于使用XE6在我的Delphi 5文件中找不到绝地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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