Cannot find jedi within my Delphi 5 file using XE6 [closed]

旧巷老猫 提交于 2019-12-25 17:43:35

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/25145897/cannot-find-jedi-within-my-delphi-5-file-using-xe6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!