Recent

Author Topic: Suddenly a build error? [solved]  (Read 2551 times)

TBMan

  • Sr. Member
  • ****
  • Posts: 350
Suddenly a build error? [solved]
« on: July 16, 2025, 04:29:30 am »
The other day I was starting to learn how to use the LCL a little and somehow a unit named strings was created. While trying to figure out what happened that nothing that used ptcgraph would compile, that strings unit opened. I realized that it was messing up everything. I deleted the strings unit from my source code folder and everything with "strings" (res, etc). Problem solved. For projects that had the error I just have to clean and build.


Now I'm getting this error:

dos.pp(8,5) Error:Can't find unit dos used by gzio

and now this one:

Warning: Recompiling dos, checksum changed for C:\LazPascal\FlowField\lib\x86_64-win64\strings.ppu {impl}

I was getting this one, but I did a rebuild of Lazarus.

strings.pas(8,46) Error:Cannot find Forms used by Strings. Check if package LCLBase is in the dependencies.
« Last Edit: July 16, 2025, 01:18:01 pm by TBMan »
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

Thaddy

  • Hero Member
  • *****
  • Posts: 18783
  • To Europe: simply sell USA bonds: dollar collapses
Re: Suddenly a build error?
« Reply #1 on: July 16, 2025, 07:23:50 am »
What is happening here is that you are writing a console app, but you use features that depend on the lazarus LCL, not just the  fpc rtl.
If you add LCL as a dependency the problem usually goes away.
Assuming you use Lazarus as editor, just add
uses interfaces, lclintf{add other units here};

This will add a dependency on LCL to the <project>.lpi file.

Note that if you use an editor other than lazarus it is a bit more complex and requires you to add the paths to the lazarus package sources to fpc.cfg. Otherwise the same uses clause extention.

But that does not explain:
strings.pas(8,46) Error:Cannot find Forms used by Strings. Check if package LCLBase is in the dependencies.
Because strings does not depend on the LCL and does not need forms.
Or is one of your own units called "strings"?
The dos unit has a dependency on the rtl unit strings and should not give that error.
When I use a small project in fp.exe, which you may use as editor, I can not reproduce with this small program:
Code: Pascal  [Select][+][-]
  1. program testdos;
  2. uses dos;{ this also parses strings, even if both are not used }
  3. begin
  4. end.
So it may be you have a completely wrong install or a duplicate fpc.cfg.

« Last Edit: July 16, 2025, 08:36:30 am by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

TBMan

  • Sr. Member
  • ****
  • Posts: 350
Re: Suddenly a build error?
« Reply #2 on: July 16, 2025, 12:17:17 pm »
Ok thanks Thaddy. I think I will do a re-install.
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

TBMan

  • Sr. Member
  • ****
  • Posts: 350
Re: Suddenly a build error?
« Reply #3 on: July 16, 2025, 12:42:00 pm »
I did a re-install and I'm still getting errors. I never changed a thing and suddenly my code won't compile.
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

Thaddy

  • Hero Member
  • *****
  • Posts: 18783
  • To Europe: simply sell USA bonds: dollar collapses
Re: Suddenly a build error? [solved]
« Reply #4 on: July 16, 2025, 06:37:08 pm »
show us some code?
I belong to before the TP generaton, btw.(and TB and PowerBasic)
« Last Edit: July 16, 2025, 06:48:15 pm by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

TBMan

  • Sr. Member
  • ****
  • Posts: 350
Re: Suddenly a build error? [solved]
« Reply #5 on: July 16, 2025, 07:04:45 pm »
show us some code?
I belong to before the TP generaton, btw.(and TB and PowerBasic)

No code to show Thaddy, but thanks for your help.
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

Thaddy

  • Hero Member
  • *****
  • Posts: 18783
  • To Europe: simply sell USA bonds: dollar collapses
Re: Suddenly a build error? [solved]
« Reply #6 on: July 17, 2025, 06:55:29 pm »
So you naughty boy DID have your own unit called "strings"... O:-)
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

TBMan

  • Sr. Member
  • ****
  • Posts: 350
Re: Suddenly a build error? [solved]
« Reply #7 on: July 17, 2025, 07:26:44 pm »
So you naughty boy DID have your own unit called "strings"... O:-)

Yes, that was weird, lmao. 
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

 

TinyPortal © 2005-2018