0

It seems I don't understand how I should configure the library folders in Delphi.

I created a package, I installed it in the IDE, I can drop it in a form and the project compiles. Then, I execute and I get an exception saying that one of the classes I use in one of the units of the package can not be found.

How is this possible? I can see the dcu files of the package.

The folder set up is like this:

  1. In the library paths, I have the folders of the folders of the .pas files (source)

  2. The .bpl file exists in the $(BDSCOMMONDIR)\Bpl directory

  3. The .dcu files exist and I have added the folder in the debug dcu path

It is a visual component (as I can drop it in a form) and the exemption is caused by a class (non-visual)
The exact error message is:

Project raised ClassNotFound with message 'class tTopBarontrol' not found"

UPDATE: I have totally removed the class which caused the error and deleted all the files. Then rebuilt the component and installed it again and for some reasons I still get the same exception with the same class name.

Looks like something is stuck in the compiler and this component.

Danilo Casa
  • 506
  • 1
  • 9
  • 18
John Kouraklis
  • 686
  • 4
  • 12
  • To whoever voted to close the question because it is unclear what I am asking...what exactly confuses you? which part is unclear? I described what I have done and what problem I am facing, I've shown efforts to resolve the issue by myself as I am aware of how the compiler behaves (path, etc) and I am asking whether there is something else I am missing which leads to the issue. So, which part is unclear? – John Kouraklis Jun 04 '16 at 15:59
  • 4
    What is the exact text of the error message? Are you building with runtime packages? Are you using dynamic loading? Is the missing class a visual component? An [MCVE](http://stackoverflow.com/help/mcve) would be useful here. – J... Jun 04 '16 at 16:03
  • @DavidHeffernan... ok, here are the details: 1. yes it is a visual component (as I can drop it in a form) and the exemption is caused by a class (non-visual) 2. the exact message is: "Project raised ClassNotFound with message 'class tTopBarontrol' not found" (as I describe in the question). 3. Am I using dynamic loading? Honestly, I don't know the answer to this. It is a component installed in the IDE – John Kouraklis Jun 04 '16 at 20:45
  • @J...Please see the comment above – John Kouraklis Jun 04 '16 at 20:45
  • Please provide [mcve] – David Heffernan Jun 04 '16 at 21:00
  • @DavidHeffernan Unfortunately, I can't for this as the package includes many units. I updated the question. Please check – John Kouraklis Jun 04 '16 at 23:54
  • Is the directory $(BDSCOMMONDIR)\Bpl in the Windows Search Path? Otherwise, your application will not be able to load it from there. – NineBerry Jun 05 '16 at 00:28
  • From your comment: Don't tell me it's a typo between *tTopBarontrol* and *tTopBarControl* ;-) Unlikely, but still... – Jan Doggen Jun 05 '16 at 07:29
  • BTW Did you check you have set the **32-bit** library path? http://stackoverflow.com/questions/36763620/library-platform-keeps-switching-to-64-bit-windows-in-delphi-seattle – Jan Doggen Jun 05 '16 at 07:30
  • @JanDoggen Yes it is a typo. But I even checked the this TTopBarControl instead of tTopBarControl but it makes no difference as expected – John Kouraklis Jun 05 '16 at 13:43
  • Guys, why is this question off-topic? There are numerous questions like this on SO like this http://stackoverflow.com/questions/3666292/should-library-path-point-to-the-source-files-of-packages?rq=1 for example – John Kouraklis Jun 08 '16 at 07:02

1 Answers1

2

I couldn't really figure out what was wrong so I took the long way to start with a clean Delphi IDE without components and I installed my package first. It took me some time but it works nicely now.

So, don't really know what was causing the problem.

Thanks for your help.

John Kouraklis
  • 686
  • 4
  • 12