views:

351

answers:

3

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?

+4  A: 
  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.
mm2010
That's what I was afraid of. Unfortunately the two units have the same name, but not the same content, not even different versions of the same unit, they're completely different. We've gone the route of trying to rename one of them, and just live with duplicate codebases for that one.
Lasse V. Karlsen
Just out of interest, why was this accepted as the answer when from what I can gather it isn't actually the right answer in this case? Barry Kelly's answer should take that honour I think.
Deltics
Cause this worked as it's the process I've always used and its detailed step-by-step. Point 1 is also the same as Barry's answer.
mm2010
+8  A: 

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.

Barry Kelly
Yeah, it worked nicely, in the sense that it compiles and runs as expected. Guess its the best we can do, since we're not going to change either codebase to use just one of the units.
Lasse V. Karlsen
A: 

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.

Read the actual question. Your "workaround" won't work, and doesn't answer the question asked.
Ken White