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.