Link to home
Start Free TrialLog in
Avatar of fva
fva

asked on

My runtime packages (and error U931)

I created long ago some packages for design-time. One of them incidentally (let's call it mylow.dpk) didn't have anything to register and other one (let's call it mycomp.dpk) did have some components. There is at least one other package (let's call it super.dpk) that has components and uses mycomp.dpk.

Now I want to switch to runtime libs.

First step: I check runtime libs and I delete all stuff in the RTlibs except for the VCL, VCLDB and so. It compiles OK, it runs OK, the EXE is significantly smaller.

Step2: I add to the list of RTlibs the package mylow.dpk (I'm using units from that in the project). It compiles again OK; all is OK.

Step3: I add to that list the package mycomp. Project compiles OK, but after compilation ends Delphi unloads super.dpl saying that something needed is missing. After that I start getting randomly Internal Error U931 on compiling.

The size of the mycomp.dpl created with Project build is significantly smaller than the size obtained when compiling the package directly.

Bottom line: How can I create runtime packages of my own, containing design-time components, too, besides the packages coming from Borland?

It's D3 CS. Please do not tell me to call tech support on that U931 error.

If I didn't manage to be clear enough, please ask for more detail or even for a rephrase of the question.

F.
Avatar of gemarti
gemarti
Flag of United States of America image

Have you looked at the help file on generating runtime packages.?

Maybe you need to do this?

The {$RUNONLY ON} directive causes the package where it occurs to be compiled as runtime only. Packages compiled with {$RUNONLY ON} cannot be installed as design-time packages in the Delphi IDE.
Place the RUNONLY directive only in .DPK files. For more information, see the Object Pascal Language Guide.
Avatar of fva
fva

ASKER

Actually I did read the Help, even if one can never claim it had been reading the Help enough :)

Well, my packages have both checkboxes set, and that means neither RUNONLY nor DESIGNONLY are included in the DPK. Nevertheless, I tried all combinations of settings.

I feel there's a big "catchy" issue missing from the Help but I cannot pinpoint it.

F.
At step 2 you added Mylow.dpk and all ran fine after compilation. Right?

Then at step 3 you added MyComp.dpk compiled and ran, but you started getting errors (U931)? Right?

You never actually add Super.bpl to the new package right?

What is in your uses clause for the Super.bpl? Did you remove a package that super.bpl uses to work?

I think you've removed something from the copiliation that the package library needs.
What's in the uses clause for MyComp units?
Avatar of fva

ASKER

No, it's not about a new package. It's about a project that I want to convert to runtime packages.
The project uses all three (mylow,mycomp and super).
No action was taken against super. It used and still uses (read require) mylow and mycomp.

Mycomp compiles OK requiring mylow, vcl30 and vcldb30.

F.
Which version of Delphi are you using now?
Avatar of fva

ASKER

D3 C/S.
ASKER CERTIFIED SOLUTION
Avatar of gemarti
gemarti
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fva

ASKER

Well, after a few days of thinking about it I found the "cure" and the explanation for it. Here it is:

When I compile/build a package using the package IDE interface, the package is built with all references included, i.e. as a project with _no) runtime libs. This enables the package to be loaded successfully by IDE because the IDE knows the full path to the package and it needs nothing more.
When the package is automatically built within a project build session that uses runtime libs, the package itself is compiled with runtime libs (that's why the packages were getting smaller). The compiler is happy with that, but the IDE obviously unloads those libraries for the duration of the compilation and wants to load them back again once the compilation is done. This is where the problem occurs, because the package "super" will need "mycomp.dpl" _in_the_system_path_ as any other DLL. Since mycomp.dpl is not in the system path, super.dpl fails when the IDE tries to load it. That's it.
I made a copy to mycomp.dpl in Windows dir (which _is_ in the system path) and the error dissapeared. Of course, this is not the final solution, since after that the mycomp copy loaded by IDE is the one in Windows dir, not the last compiled one, but at least I see the light.
I'm facing a huge package restructuration, combined with some path reconfiguration, but I'm pretty sure it'll solve my problems.

Thank you all who showed up in this thread.

F.
Points reduced to 25 as requested in https://www.experts-exchange.com/jsp/qShow.jsp?ta=commspt&qid=20167422

modder
Community Support
Avatar of fva

ASKER

Thank you gemarti for bothering with this question. I'll award these 25 pts to you for that.

F.