Jump to content
JKNew

Error when installing custom package - Module not found

Recommended Posts

Hi.

I know that this is something that has been posted about before. However, the reason that I am making a new one is because the given solutions have not helped to solve it in my own case. 

First of all, I am completely new to Delphi. I have coded in various other languages but Delphi is new territory. Currently, I am attempting to getting a grip over a collection of Delphi projects, all together making up a complex application. The original author of the application is not available anymore. I am going through this kind of blind. 

I know that there is a certain package, containing a bunch of modules that are dependencies throughout various project files. I have managed to fix the references in the bpl project (Most difficulties were associated with QuickReport). The bpl project does build and compile, although when I try to install the package, either in the Package Manager or by right clicking the node and choosing Install, it says: Cannot load package {path}\JEP.bpl Specified module cannot be found.

I know this is something a bunch of other people have run into, but I have tried a lot of different suggestions, none of them fixed this issue for me. I have double checked the required references, cross referenced that the respective dcu files are present in the output directory after compiling. I honestly don't know how to more forward on my own.

 

I sincerely hope some of you can be of assistance.

Kind regards

Jakob

Share this post


Link to post

What are the output directories for that package?

There is an answer on Stack Overflow that I believe is a good way of looking at the problem: Can't load package %s error while installing a package

 

It basically employs SysInternal's Process Monitor to see where the IDE is looking for that package. This gives you an idea of of where the IDE thinks the package should be compared to where you are actually putting it.

Edited by PeaShooter_OMO

Share this post


Link to post
24 minutes ago, JKNew said:

it says: Cannot load package {path}\JEP.bpl Specified module cannot be found.

This is a little tricky indeed, most likely your JEP is using (referencing) a unit that is included in different package, JEP is expecting another (un-named here) run time package to be loaded first.

Find/identify the missing or referenced unit file and handle it, or change JEP Build control from project option, does Explicit or rebuild as needed selected ?!, start there .

Share this post


Link to post

Yes. I have seen that post. When I try to follow that procedure (I have filtered for Create File, because there is no over all File Operation), it provides me with the I/O flow. 

I can see that it says NAME NOT FOUND for some file that is just called ".svn" I have no idea what this is. 

It is also looking for rtl.bpl which it cannot find. But I not know what this rtl.bpl is supposed to be. I can see that it is listed in the Requires scope of my package. The same goes for vcl and vcldb. 

I'll have to go over why they are missing and add them to the search path

Share this post


Link to post

It's the Windows path that you have to update. Since BPL is a special type of a DLL the OS involved in loading the required packages. When a designtime package (that you want to install) is referencing the runtime package (it can also be a single package runtime + designtime) the OS (Windows) must locate it. Setting the search path will not resolve the bug. 

Share this post


Link to post

I have narrowed it down a bit.

Delphi is looking for some rtl.bpl, vcl.bpl, dbrtl.bpl, vcldb.bpl files. They are listed in the Required scope in my package. The issue is, they appear to be installed in the Package Manager. Both RTL and VCL, but Delphi is looking for file specifically named vcl.bpl etc, and they do not exist on my system or any where else in the source code. The IDE has dclrtl280.bpl which the RTL package is installed from, same goes for VCL. 

I don't know if this is a common issue and it just is because I'm new that I don't know how this is fixed or there is some other explanation. 

I hope you can help.

Thanks

Share this post


Link to post
19 minutes ago, Lajos Juhász said:

It's the Windows path that you have to update. Since BPL is a special type of a DLL the OS involved in loading the required packages. When a designtime package (that you want to install) is referencing the runtime package (it can also be a single package runtime + designtime) the OS (Windows) must locate it. Setting the search path will not resolve the bug. 

Okay, interesting. Can you elaborate in which way specifically I should update the Windows path? and to where

Share this post


Link to post
3 minutes ago, JKNew said:

Delphi is looking for some rtl.bpl, vcl.bpl, dbrtl.bpl, vcldb.bpl files.

There is no such files, these should have RTL numbers, i suggest to try the project manager, right click on all the required packages then remove them all, after that the IDE on building will ask you to add the needed ones, this for me solves such conflict in many cases/incidents in the project file, specially after upgrading/downgrading between IDE's.

image.png.527327977045cf0bfd30d336d23818bd.png

These will stay without numbers in the projects but will be adjusted later and internally without your interaction.

Share this post


Link to post
15 minutes ago, Kas Ob. said:

There is no such files, these should have RTL numbers, i suggest to try the project manager, right click on all the required packages then remove them all, after that the IDE on building will ask you to add the needed ones, this for me solves such conflict in many cases/incidents in the project file, specially after upgrading/downgrading between IDE's.

image.png.527327977045cf0bfd30d336d23818bd.png

These will stay without numbers in the projects but will be adjusted later and internally without your interaction.

Thanks for your reply. I had no idea that it would be OK to remove those references.

Anyway, I did that and it cannot compile now - It finds an error with the DesignEditors unit, saying: Could not compile used unit. The unit is present and I can CTRL+click and navigate to it. It is locked though. 

Usually that meant that the IDE was missing a path to said unit, but here it looks like it is not missing a reference path some some kind of different issue.

Share this post


Link to post

I have followed the documentation regarding adding DesignIntf to the project. 

Adding designide.dcp to the Requires folder. Then it gave an error about missing various QR units. Then I added QRWRunDXE10_2_w64.dcp to the Requires folder. Delphi prompted me with a list of dependencies it needed, I clicked Save and the original list of dcp files in the Requires folder has returned. Just as it appeared previously. I can compile but I still cant install the package. 

I have come full circle now and back to square 1.

Share this post


Link to post
22 minutes ago, JKNew said:

Anyway, I did that and it cannot compile now - It finds an error with the DesignEditors unit, saying: Could not compile used unit.

Now you are on the path to find the real problem.

 

Try to solve the conflict in 

image.thumb.png.e1a3a9d06c904b0066425abdccf80ca1.png

Those depends on your package and its imported units.

Edited by Kas Ob.

Share this post


Link to post
3 minutes ago, Kas Ob. said:

Now you are on the path to find the real problem.

 

Try to solve the conflict in 

image.thumb.png.e1a3a9d06c904b0066425abdccf80ca1.png

Those depends on your package and its imported units.

All right, so the settings you have provided are the same as for this package. I have not changed them and they match your example

Share this post


Link to post

You wrote that you want to install a runtime package in that case you cannot add a 64 bit bpl to required, runtime package must be 32. The Delphi IDE is 32 bit it requires a 32 bit bpl cannot load a 64 bit version (from the name w64 I guess it's a 64 bit package).

 

Anyway the 32 bit version of the QuickReport package must be on a Windows path. You can add it for the Delphi IDE (Tools - Options - Environment Variables) and select path at the User System Overrides.

Share this post


Link to post
2 minutes ago, Lajos Juhász said:

You wrote that you want to install a runtime package in that case you cannot add a 64 bit bpl to required, runtime package must be 32. The Delphi IDE is 32 bit it requires a 32 bit bpl cannot load a 64 bit version (from the name w64 I guess it's a 64 bit package).

 

Anyway the 32 bit version of the QuickReport package must be on a Windows path. You can add it for the Delphi IDE (Tools - Options - Environment Variables) and select path at the User System Overrides.

I know the the name suggests it is a 64 bit bpl, but the dcp it gathered from QuickReport win32\release. I have the win64 folder aswell, but I am using the one from the win32 directory. They have the same name though

Share this post


Link to post
5 minutes ago, JKNew said:

All right, so the settings you have provided are the same as for this package. I have not changed them and they match your example

You should change them !

 

See if you are using the DesignEditors then your package should be Design time only and most likely will fail to build if it using the QuickReport if not in the require section as needed, as Lajos wrote, only the IDE will find it for you, as it should be already loaded for your package to loaded by the IDE then installed.

Share this post


Link to post
10 minutes ago, Kas Ob. said:

You should change them !

 

See if you are using the DesignEditors then your package should be Design time only and most likely will fail to build if it using the QuickReport if not in the require section as needed, as Lajos wrote, only the IDE will find it for you, as it should be already loaded for your package to loaded by the IDE then installed.

Okay. I have changed it to Design Time Only. Although it did not seem to fix the issue. If I remove all the requirements, it still wants me to add designide.dcp and the QRWRunDXE10_2_w64.dcp. When I do that it can compile but not install. If you choose the Explicit rebuild option, an error pops up saying: "Never build package JEP.bpl requires always-build package QRWRunDXE10_2_w64". 

Share this post


Link to post
1 minute ago, JKNew said:

Okay. I have changed it to Design Time Only. Although it did not seem to fix the issue. If I remove all the requirements, it still wants me to add designide.dcp and the QRWRunDXE10_2_w64.dcp. When I do that it can compile but not install. If you choose the Explicit rebuild option, an error pops up saying: "Never build package JEP.bpl requires always-build package QRWRunDXE10_2_w64". 

Dear, your problem is not with your package itself, yes designide may be should added by manually, but the QR package build is broken and is the cause of this issue, i don't think w64 should appear anywhere near design time packages.

I suggest to completely remove (uninstall) the QR package and rebuild/install it from scratch, make sure to delete all the bpl and dcp for QR.

 

Also if you look at the installed and loaded packages in the IDE ( IDE Menu -> Component -> Install Packages... ) you should have this window

image.thumb.png.d8d19c570af0c748a29ead05c1c59849.png

Again i don't have QR, but the same goes for all packages.

If a packages is installed then it have an entry in this window.

If the package is loaded then the checkbox is checked, unchecked means it is install but not loaded.

 

So when cleaning QR make sure also all (or any) entries referring to QR are gone.

Share this post


Link to post
1 minute ago, Kas Ob. said:

Dear, your problem is not with your package itself, yes designide may be should added by manually, but the QR package build is broken and is the cause of this issue, i don't think w64 should appear anywhere near design time packages.

I suggest to completely remove (uninstall) the QR package and rebuild/install it from scratch, make sure to delete all the bpl and dcp for QR.

 

Also if you look at the installed and loaded packages in the IDE ( IDE Menu -> Component -> Install Packages... ) you should have this window

image.thumb.png.d8d19c570af0c748a29ead05c1c59849.png

Again i don't have QR, but the same goes for all packages.

If a packages is installed then it have an entry in this window.

If the package is loaded then the checkbox is checked, unchecked means it is install but not loaded.

 

So when cleaning QR make sure also all (or any) entries referring to QR are gone.

Okay. Thanks a lot for your help.

It makes sense that the QR package is the culprit. 

 

I have a laptop next to me from the author where some of the original development environment has been installed upon, but not completely. I noticed that QuickReport 5.06 in listed in the Package Manager, and the design time package can be compiled on that system. Hence, installed correctly.

Although, when I try to compile the QuickReport Design time package on my system, it comes with 2 fatal errors:

"QR5Run_RAD6.dpk: E2225 Never-build package 'rtl' must be recompiled"

"QR5Design_RAD6.dpk: E2202 Required package 'QR5Run_RAD6' not found".

 

So in order to correctly install Quickreport on my system, I must recompile the QR design time package, but recompile 'rtl' before that can be done.

 

We are getting closer

Share this post


Link to post

SUCCESS!

 

I opened the source project for QR Run package and recompiled that one.

Then I opened the one for QR Design (which depends on the Run package), that one successfully recompiled as well and I could install it in the correct way. It is now listed in the Package Manager alongside the other packages.

Then I tried to build and install my custom package JEP.bpl and IT WORKED! 

My custom package is now present in the package manager as intended and it appears application projects which uses units from that package can access them.

 

PHEW... 

 

I cannot stress how relieved I am now. I appreciate your assistance very much!

  • Like 1

Share this post


Link to post
3 minutes ago, JKNew said:

but recompile 'rtl' before that can be done.

NOOOOOO ! Don't go there .

 

Just perform clean QR removal and follow its instruction to the letter to install, if QR package project file had been changed or modified then you have to either repeat the same process you have done above, i mean removing the needed ...., or just restore the orginal QR package projects.

In other words if you didn't change the QR source then delete it completely and try with clean library code.

Very popular mistake that cause errors like this. is that the IDE have made some changes or you did or even there was a conflict in the runtime/design time packages when you installed a packages (QR in this case) and the IDE asked you to save the project and you clicked yes, make this conflict hidden.

 

Share this post


Link to post
1 minute ago, JKNew said:

I cannot stress how relieved I am now. I appreciate your assistance very much!

Happy for you and happy more for the experience you got out of this issue !

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×