Recent

Author Topic: Resource references  (Read 2051 times)

Degibbo

  • New Member
  • *
  • Posts: 46
Resource references
« on: October 17, 2018, 01:58:42 am »
G'day all,
I recently changed the name of a project main form, but compiling now fails by trying to open the old unit.  This results in a "duplicate" main form error.

I have searched all project files for the old unit name, and nothing is found.  I suspect that Lazarus has a secret hidey-hole for past used references, but where?

How do I remove all references to the old unit file?

Cheers & thanks,
DG

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Resource references
« Reply #1 on: October 17, 2018, 05:02:57 am »
Just a thougt: Have you looked in the project.lpi* file? It may not have been correclty updated.


* Change "project" by your project's name, of course.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Degibbo

  • New Member
  • *
  • Posts: 46
Re: Resource references
« Reply #2 on: October 17, 2018, 11:51:37 pm »
Thanks for the response.  Yes, the lpi file is all correct.  I can't find reference to the troublesome file anywhere in the project, but Lazarus still want's to try and open it, so it must have the filename stored somewhere!

Cheers,
DG

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Resource references
« Reply #3 on: October 18, 2018, 12:18:49 am »
I can't find reference to the troublesome file anywhere in the project, but Lazarus still want's to try and open it, so it must have the filename stored somewhere!

Another posibility is that it's somehow stuck as a dependency. Look in the project inspector (Menu: Project -> Project Inspector) and/or in the Project->Units. It *must* be referenced somewhere, otherwise the compiler wouldn't be trying to find it--or, in fact, finding it given the "duplicate main form" error you get.

If you shared your project's files it'll be easier to find the solution.
« Last Edit: October 18, 2018, 12:23:42 am by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

sash

  • Sr. Member
  • ****
  • Posts: 366
Re: Resource references
« Reply #4 on: October 18, 2018, 12:49:11 am »
I recently changed the name of a project main form

Could you be more specific? What exactly you did, renamed unit/filename/classname/generated variable name? And how exactly?
Lazarus 2.0.10 FPC 3.2.0 x86_64-linux-gtk2 @ Ubuntu 20.04 XFCE

 

TinyPortal © 2005-2018