Recent

Author Topic: [SOLVED] RequireDerivedFormResource problems  (Read 4347 times)

JD

  • Hero Member
  • *****
  • Posts: 1906
[SOLVED] RequireDerivedFormResource problems
« on: October 27, 2013, 12:18:42 am »
Hi there everyone,

Once in a while I run into a problem with Lazarus that reminds me of its rough edges & drives me up the wall. I'm working on an application that has been working fine for some years now. All of a sudden, when I start the application after compilation, I get an error saying

Form resource TfrmProject1 not found. For resourceless forms, CreateNew constructor must be used. See the global variable RequireDerivedFormResource.

and the application terminates!!!!  :o

I had already addressed this problem when the transition to using RequireDerivedFormResource first appeared. RequireDerivedFormResoure := True in my project's lpr file.

The project's resource file is in the same directory as the executable so I don't know what Lazarus is complaining about!

Any advice on how to get around this problem?

Thanks,

JD
Lazarus-1.1-42799-fpc-2.6.2-20130915-win32
« Last Edit: October 28, 2013, 12:34:53 am by JD »
Linux Mint - Lazarus 4.0/FPC 3.2.2,
Windows - Lazarus 4.0/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

Bart

  • Hero Member
  • *****
  • Posts: 5573
    • Bart en Mariska's Webstek
Re: RequireDerivedFormResource problems
« Reply #1 on: October 27, 2013, 12:49:21 am »
You are probably missing the
Code: [Select]
{$R *.lfm}

in the forms unit.
This can haenn if you switch from "old style" (*.lrs) to "new style" resources in an existing program (Lazarus does not add it automatically).

Bart

JD

  • Hero Member
  • *****
  • Posts: 1906
Re: RequireDerivedFormResource problems
« Reply #2 on: October 28, 2013, 12:33:52 am »
Thanks a million Bart. That was it. I may have deleted it by mistake because it was there before. Must be due to too many coffee fueled late nights coding.
Linux Mint - Lazarus 4.0/FPC 3.2.2,
Windows - Lazarus 4.0/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

 

TinyPortal © 2005-2018