“Duplicate” units in Delphi by name, referenced by components, problem with compile

StackOverflow https://stackoverflow.com/questions/887435

  •  23-08-2019
  •  | 
  •  

Question

We are using several component packages by different vendors, and two of them both have a "regexp.pas" unit available inside their directory structure.

Problem now is that regardless of the order we compile them in, one of them complains about the unit being compiled with the wrong version of various other units.

Is there any way to handle this correctly?

Was it helpful?

Solution

  1. You must make sure that you have only one version of that unit
  2. Delete all dcu's (of both vendors) to force re-compilation of all the source.
  3. Uninstall the 2 vendor's packages completely (Ensure that every trace of each is removed everywhere)
  4. Recompile & Install one at a time.

OTHER TIPS

No two units can have the same name in any fully linked and loaded Delphi executable, whether the units are statically linked or dynamically linked via packages. As you concluded, you'll have to rename one or the other.

You can use this workaround.

As already told, you cannot load both vendor packages into the IDE together.

However, if you need them one at a time, you can start up two different IDE profiles using the "-r" command line switch, giving a custom name to each profile. Then, you could launch Delphi using the first profile, and install the first of the two "clashing" packages, close the IDE and run Delphi with the second profile, and install the other package.

Create a shortcut for each profile, and then run Delphi choosing the profile that loads the package you need to mantain a specific project.

Regards, ~/|/|arco.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top