views:

1175

answers:

3

I'm trying to build 3 packages, A, B and C. A defines some base classes that are used in B and C. I've got all 3 of them in the same project group, all set up to output to the same custom BPL output folder. This folder is in the search path for B and C. But when I go to build B and C, the compiler chokes on the Requires list. "Required package 'A' not found."

How do I tell B and C where to find A so they'll build correctly?

+7  A: 

Either the package can't be found, or the compiler is confused. In the later case, a restart sometimes helps. Then a manual build from all packages in order.

If it really can't be found, check if all package (bpl and dcp) and dcu files are available. You need both.

Gamecat
That turned out to be the problem. I needed to tell it where to find the DCP file too.
Mason Wheeler
Struggled with that one once.
Gamecat
having this problem now with a DCP file that exists but something else is unsettling delphi and it won't read the DCP file, no amount of restart will help, or rebuild.
Warren P
+1  A: 

I would check to make sure where you are writing the .dcp files for the packages. once you have this, check that the search path of each package has an entry for the .dcp output folder.

MikeJ
+2  A: 

If this happens when the IDE is trying to load a package: your package output directory (where the *.bpl files go) has to be on your system's PATH environment variable. Packages are statically linked DLLs, Windows has to be able to find them to load them.

If this happens when building the packages: any/all of your DCP output directories (where the *.dcp files go) have to be in the dependent projects' search path so that the compiler can find the compiled packages. You can also leave the DCP output directory of the package project empty - in which case the global DCP output directory set in Tools\Options\Library is used; the dependent projects then don't need to include it in their search path.

TOndrej
Wow, a BPL folder NOT in your path. The IDE should whine about this.
Warren P