Recent

Author Topic: Lazarus broke my project  (Read 1474 times)

BlackVoid

  • Newbie
  • Posts: 5
Lazarus broke my project
« on: November 15, 2025, 04:59:13 pm »
I was working on a project some months ago. I wanted to continue now, but what I have found that it compiles, then shows the application icon, but not the application window.

How can this happen???
Very discouraged to use this for anything....

TBMan

  • Sr. Member
  • ****
  • Posts: 307
Re: Lazarus broke my project
« Reply #1 on: November 15, 2025, 05:11:03 pm »
I was working on a project some months ago. I wanted to continue now, but what I have found that it compiles, then shows the application icon, but not the application window.

How can this happen???
Very discouraged to use this for anything....

LMAO, maybe try learning to code in BASIC first?
I love programming.

Some things I've done using PTCgraph:

NFL Retro Football (almost finished):
https://www.youtube.com/watch?v=78mTtsd7ppk


Solitaire games:
https://www.youtube.com/watch?v=zmtxI7FdWuQ&list=PLa4BPpFl34iVhFwX1JZwVm3vE5ay_i3R2

Thaddy

  • Hero Member
  • *****
  • Posts: 18524
  • Here stood a man who saw the Elbe and jumped it.
Re: Lazarus broke my project
« Reply #2 on: November 15, 2025, 05:12:19 pm »
That looks like some of the configuration or resource (*.lpi, *.res, *.lfm) files are missing: you have a broken project.
A Lazarus project consists of way more than the Pascal sourcecode alone
That is usually not Lazarus fault, but a mishap in maintaining the sourcecode.

You can't simply omit or delete files and then expect a project to work.
If you have the lpr, the pas files and the lfm files the project is likely recoverable.
A new lpi file will be created, but don't lose it again. If you lost the lfm files you are in big trouble and you need to create them again through the Lazarus IDE and build it - by hand - exactly like your layout was when you wrote the program.
If you lost even more files you did not read the documentation that comes with Lazarus.
« Last Edit: November 15, 2025, 05:22:48 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Handoko

  • Hero Member
  • *****
  • Posts: 5507
  • My goal: build my own game engine using Lazarus
Re: Lazarus broke my project
« Reply #3 on: November 15, 2025, 05:21:24 pm »
Lazarus is quite unbreakable. One of the possible way to get the result as OP said is:
Lazarus main menu > Project > Project Options > left panel: Project Options - Forms > remove all items inside Auto-create forms

If that is the case of OP, to fix it move all the forms back to the auto-create section.

If it doesn't work, restore a backup. If have no backup, then  >:D
Always keep a backup for good working code.
« Last Edit: November 15, 2025, 05:25:52 pm by Handoko »

Thaddy

  • Hero Member
  • *****
  • Posts: 18524
  • Here stood a man who saw the Elbe and jumped it.
Re: Lazarus broke my project
« Reply #4 on: November 15, 2025, 05:23:41 pm »
Only if the lfm's are there...
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Handoko

  • Hero Member
  • *****
  • Posts: 5507
  • My goal: build my own game engine using Lazarus
Re: Lazarus broke my project
« Reply #5 on: November 15, 2025, 05:28:18 pm »
Only if the lfm's are there...

Restoring from backup never fails.

I keep multiple backups for my code, and its change log.
No matter how careful we are, mistakes often happen.
Programmer who doesn't keep backup is either a newbie or stupid.
« Last Edit: November 15, 2025, 05:32:56 pm by Handoko »

wp

  • Hero Member
  • *****
  • Posts: 13268
Re: Lazarus broke my project
« Reply #6 on: November 15, 2025, 05:47:20 pm »
I have found that it compiles, then shows the application icon, but not the application window.
I have this often when testing projects submitted by forum users with a second monitor who drag their forms on the second screen. Then when I open this project on my single-monitor system the Left coordinate of the form is way to the right, outside my screen.

So, when you open your project in Lazarus, first look at the source editor. Is there some code? No - ok, then the others are correct and your project is broken somehow. Yes - look at the object inspector (the table-like panel at the left), scroll down so that you see the "Left" property. What is its value? If it's unreasonably large or small (negative) you probably have the case that I described - just reset it to something like 100 or so, and the form should jump into view.

Handoko

  • Hero Member
  • *****
  • Posts: 5507
  • My goal: build my own game engine using Lazarus
Re: Lazarus broke my project
« Reply #7 on: November 15, 2025, 05:56:11 pm »
I just remembered, I ever got a bug in the past when designing a form. It happened only with certain combination of mouse scrolling and editing the property of the form. Something like that, can't remember the detail. The form's position would go wildly outside the screen area.

To fix it:
Lazarus main menu > Window > Center a lost window

jamie

  • Hero Member
  • *****
  • Posts: 7407
Re: Lazarus broke my project
« Reply #8 on: November 16, 2025, 12:00:37 am »
maybe just maybe a configuration component was used to save/restore the apps settings and like WP said, was set the last time on a different monitor configuration, even though you can see the forms on the designer screen.

 For example, one of those little things called .XXX propertystorage component or even a simple INI file.

 apps, should always check the current screen layout on startup to ensure the last time settings will apply, and if not make some correction during the startup.

Jamie
The only true wisdom is knowing you know nothing

Handoko

  • Hero Member
  • *****
  • Posts: 5507
  • My goal: build my own game engine using Lazarus
Re: Lazarus broke my project
« Reply #9 on: November 16, 2025, 04:47:15 am »
apps, should always check the current screen layout on startup to ensure the last time settings will apply, and if not make some correction during the startup.

+1

LV

  • Sr. Member
  • ****
  • Posts: 380
Re: Lazarus broke my project
« Reply #10 on: November 16, 2025, 07:18:19 am »
Very discouraged to use this for anything....

A poor worker always blames their tools. ;D

440bx

  • Hero Member
  • *****
  • Posts: 5896
Re: Lazarus broke my project
« Reply #11 on: November 16, 2025, 07:46:11 am »
Very discouraged to use this for anything....

A poor worker always blames their tools. ;D
That's the reason people hit their fingers with a hammer.  Hammers are well known to have very poor eyesight ;)
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11923
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus broke my project
« Reply #12 on: November 16, 2025, 09:12:11 am »
First, make a backup, if you havent yet.

So you don't damage anything while trying to fix it.

I was working on a project some months ago. I wanted to continue now, but what I have found that it compiles, then shows the application icon, but not the application window.

How can this happen???
Very discouraged to use this for anything....

Does it show the form (window) in design mode? When you press F12 to edit it?

Have you tried a clean "build" => menu: run > build ?

Are you sure its not your antivirus or something like that?

Did you locate the exe, and try to run it outside the IDE?

Does a new project work?



Looking at the replies, other people didn't get that error... That does not make it any better for you, but well, it shows you just got very unlucky to get that problem.

And while I understand that you don't have much information, the short post you made does not allow for much help. Even (especially) the simplest of errors can have a million reasons... From the 2 lines of info you gave, no one can tell what is going on.

What OS do you use?
What hardware (CPU, bitness)
What version of Lazarus?

How big is the project? Does it have a single form, or many. Does it have lots of units?

Do you use any 3rd party packages? E.g. stuff installed via "online package manage" or downloaded from somewhere?

Database?

External dll (e.g. sqlite.dll)?


af0815

  • Hero Member
  • *****
  • Posts: 1406
Re: Lazarus broke my project
« Reply #13 on: November 16, 2025, 10:59:53 am »
If you open the Projectmanager and look if one form ist opened under "Auto-create forms"


regards
Andreas

cdbc

  • Hero Member
  • *****
  • Posts: 2524
    • http://www.cdbc.dk
Re: Lazarus broke my project
« Reply #14 on: November 16, 2025, 11:32:23 am »
Hi
Have none of you noticed, that he just started the discussion and left the room...!!!
Pretty clever...  %)
Kind Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

 

TinyPortal © 2005-2018