Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: Missing Dcu

Tags:

delphi

[DCC Fatal Error] Unit1.pas(7): F1026 File not found: 'MyBitBtn.dcu'

Unit1 is a VCL Form for test purposes.

I have installed a design time package which contains a custom component that derived from TBitBtn. I can load the MyBitBtn in the Delphi IDE, load up the custom images I coded in design time and it seems like it works fine, at least visually. I get the above compile time error when I try to compile the test project.

I have a package group that has one design time package and one run time package. Design time package registers the component and Runtime package inherits the TBitBtn and has the custom code in it. The design time package contains the RunTime DCP file in the requires section.

The moment I insert the custom button on the test form, IDE creates the USES clause for MyBitBtn file. And that file apparently can't be found. Shouldn't that be part of the package installed?

like image 920
Alex Avatar asked Dec 20 '12 16:12

Alex


2 Answers

Most probable you did not set 'Unit output directory' option in your runtime package, so package .dcu's are not available; I usually set it to $(BDSCOMMONDIR)\Dcp and have no problems.

Generally, the .dcu's of a runtime package should be available via global IDE library path if you want your package to be available to any project:

lib path.

You should either use one of the existing paths or add your own.

like image 117
kludg Avatar answered Oct 05 '22 10:10

kludg


The design part works, but for run time, the compiler must be able to find the dcu. You can do that either...

  1. By adding the dcu folder to the library path of the IDE.
  2. By adding the dcu folder to the search path of the project.
  3. Or by adding the dcu explicitly to the project.

I would choose the first option. Since it's an installed component, you would want it to be available for any project, so setting the library path makes the most sense.

like image 23
GolezTrol Avatar answered Oct 05 '22 11:10

GolezTrol