Edijs Kolesnikovičs
Edijs Kolesnikovičs

Reputation: 1695

Why x.dfm is missing while it is inside package?

I have created a package - a custom component. Package contains *.pas and *.dfm. I compile package and add *.DCU path to Library. I drop my component from Tool Palette to test application form and Delphi complains that it can not find x.dfm. If I add dfm to Library path - test application compiles just fine. For me it is kinda hack'ish what I am doing. What I am missing? Thank you.

Update 1: My component shows custom form. My *.pas file haves {$R *.dfm}

Upvotes: 3

Views: 795

Answers (1)

Uwe Raabe
Uwe Raabe

Reputation: 47758

When you install a custom component inside the IDE, the package is normally only used during design time.

When you drop a component onto a form and compile your application, you have to provide the dcu and dfm files for the compiler and linker. This is the same for all other used units, too. Just have a look into the lib folder of Delphi.

If you compile with packages you can omit the dcu and dfm files as they are contained in the package dcp file. In that case you have to provide all needed bpl files together with your exe file. I am not sure if this is what you want.

Upvotes: 4

Related Questions