2

I'm trying to install a 3rd party package for Delphi 7. After opening the DPK, I pressed the Install button, and got a File not found error. The same happens if I press Compile first, and then Install.

The error message refers to the unit which is listed first in the contains section of the DPK. The package directory does not contain PAS files, but it contains the DCU for every PAS listed in the contains section. The package directory is added to the Library path. I tried to turn off Explicit rebuild, but it didn't help. I also tried to remove the references to PAS files and add the DCU files instead, but the error message remained the same.

Delphi apparently wants to recompile the package, but I don't have the source files. What should I do to make it use the DCUs? Thank you for your help in advance.

3 Answers 3

6

The fact that the compiler wants the source (even though the .dcus are available) usually means that the .dcu files were compiled by a different version of Delphi. .dcu files are not compatible across compiler versions (with the single exception of D2006->D2007), meaning that every new version release of the compiler means all your source needs to be recompiled in order to be compatible with it.

You'll need to contact the vendor to get new .dcu files that are compatible with your current Delphi version.

If you have the updated source already, the compiler is not finding it in order to recompile, which means you need to check the Project->Options->Directories and Conditionals->Search Path to make sure it's updated. You may also need to check Tools->Options->Environment Options->Delphi Options->Library - Win32->Search Path, depending on how you installed the previous version.

This is the reason that you should never buy or use third-party packages without getting the source code. You now depend on the vendor getting the files out to you (or still being in business), and you're stuck until they do.

3
  • +1 Thank you. Interestingly, the package looks like as if it was compiled with Delphi 7 (the name of the DPK, CFG and RES files end with "_D7"), and I use Delphi 7, so there shouldn't be version problems in theory. I tried to install the package with and without installing Delphi 7 Update 1, but this didn't solve the problem. Is it possible to determine the version of Delphi a DCU was compiled by?
    – kol
    Dec 30, 2012 at 15:50
  • Are there versions of the same files with different Delphi versions as well (eg., D6 or D2007)? Are the .dcu files in the same folder as those package source files? AFA which version, I don't know. A quick search of "compiler version from dcu" didn't turn up anything.
    – Ken White
    Dec 30, 2012 at 16:25
  • There are three versions for the RES: D5, D6 and D7. There is only one version of each DCU. All files are in the same folder. -- I accept your answer since I think version incompatibility is the most probable explanation of the problem. The DCUs don't have "D7" in their name, maybe these haven't been compiled with Delphi 7.
    – kol
    Dec 30, 2012 at 18:25
1

There is an update for Delphi 7 (known as 7.1). DCUs are not compatible between these. Do you have the update installed? Please see: http://edn.embarcadero.com/article/32337 http://edn.embarcadero.com/article/32400

0

File not found error means the compiler can not find the pas files. "The package directory does not contain PAS files..." but you added the package directory to the Library path so the compiler can not find the pas files. Make sure there is a library path set in the IDE to the folder containing the pas files for the package if you have the pas files. If you do not have the pas files then get them from the developer.

2
  • This is a 3rd party plugin. I don't have the PAS files, only the compiled DCUs. I have all of the DCUs needed by the package. In spite of this, Delphi apparently ignores the DCUs and wants to get the source code to compile new DCUs. The author of the package compiled the DCUs using Delphi 7, and I also use Delphi 7, so the DCUs should be enough, at least theoretically. Unfortunately I don't know how to stop Delphi trying to recompile them.
    – kol
    Dec 30, 2012 at 15:12
  • Are your compiled DCUs in the search path? Dec 30, 2012 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.