views:

413

answers:

1

I have a problem with a application with plugins. Originally, everything was compiled into a single exe, but now, I want to take out some of the code into a bpl on its own. The code that is shared by both the exe and the new bpl is put into a third bpl.

application.exe is compiled with package api.bpl api.bpl contains only one file, api.pas plugin.bpl requires api.bpl.

I have the following structure on disk:

.\ - final output for exe and bpls
.\src - sourcefiles for application.exe and api.bpl, including shared api.pas
.\dcu - dcu output for all projects
.\plugin - plugin source

I can compile application.exe without a problem.
I can compile api.bpl without a problem.
But when I try to compile plugin.bpl, it tries to build api.bpl first, an then it complains that it can't find api.pas.

Why is that?

+1  A: 

This is a quirk in Delphi's build system. It's trying to build the dependent package under the same build rules as plugin.bpl, not under its own rules. Look in Project Options for plugin.bpl and make sure it has the same paths as api.bpl, and then it should work.

Mason Wheeler
but api.pbl doesn't have any paths, since the only file it uses is the one it contains, and that file is in the same folder as the package source...Maybe I should try to move it into it's own folder?
Vegar
Anyway, plugin.bpl has ..\src\ in it's search path, and that should work for api.bpl to, shouldn't it?
Vegar
@Vegar "and that should work for api.bpl to, shouldn't it?" Try it and give us the answer. ;-)
Heinz Z.
@Heinz: Plugin has the ..\src\ in it's search path, which gives access to the api.pas-file. The answer suggests that the problem comes from the fact that api.bpl is build with the rules of plugin.pbl, and suggest that I add the source paths from api.bpl to plugin.bpl. Api.bpl has no search path, as it contains and use no more then one file, api.pas. Plugin.bpl also uses this file, and already has it in it's source path.So, '.., and that should work, ..., shouldn't it?' means that I have already tried what he suggests, and it doesn't work, but it should...I have no answer...
Vegar