Recent

Author Topic: [SOLVED] Lazarus version 2.0.12 under 32-bit win can't compile anything.  (Read 1389 times)

JuJu

  • Newbie
  • Posts: 2
Hello,
I really hope somebody here might know how to solve it.

I couldn't find any solution so far in the internet. I made a program on a Win 64 bit system but couldn't get the cross compiler to work, so I tried to cheat my way out, by simply getting Lazarus for 32 bit system on another device.

But this version kinda acts up, no matter, what I try to compile (empty form with no code, an example from Lazarus, or my project that works perfectly, on the 64 bit Lazarus).
The new device never had Lazarus, so no old ghosts screwing things up.

The error always happens to be (with different position depending on the project, I try to compile):

"fpcadds.pas(25,32) Fatal: Can't find unit FPCAdds used by LazUTF8"

In my opinion such an error should be impossible for a not modified installation of an IDE.
So how can I solve it? It says it can't find what Lazarus would expect it to find at that point. So it should be solvable with settings/ Linker and so on?
And if so, how do I do it?

I hope somebody knows a solution.

Thank you, for your time. :)

JuJu.

Edit: Solved issue.
« Last Edit: March 18, 2021, 09:01:20 pm by JuJu »

wp

  • Hero Member
  • *****
  • Posts: 8548
Re: Lazarus version 2.0.12 under 32-bit win can't compile anything.
« Reply #1 on: March 18, 2021, 03:08:51 pm »
Let me repeat to make sure that I understand correctly:

You installed a 32-bit version of Lazarus 2.0.12 onto a Win64 system which never had seen Lazarus before, but you cannot compile even the simplest project?

I am working on such a system, and do not have any problems with it. It's hard to say from the distance what's wrong in your case. Maybe the simplest advice of all: uninstall Lazarus, delete the folder with your user settings (by default c:\users\<your name>\appdata\local\Lazarus). Re-download the installation file. Make sure to pick the correct one. Since you are on a 64-bit system the installer proposes to you by default the 64-bit Lazarus but you want the 32-bit version (but the 64-bit version is working correctly, too, so it would not be harmful to pick the wrong one). The download for the 32 bit version is https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%202.0.12/lazarus-2.0.12-fpc-3.2.0-win32.exe/download, the one for the 64 bit version is https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.12/lazarus-2.0.12-fpc-3.2.0-win64.exe/download.

You mentioned cross-compilation. Do you mean that you have a 64-bit version on your other system and want to cross-compile 32-bit applications from it? Cross-compilation always has been too complicated for me (to many changes in the setup). Therefore, when I want a 64-bit and a 32-bit binary from the same source I simply install the other Lazarus in addition to the first one - harddisk spaces costs nothing nowadays. If you want to have several Lazarusses on the same system you should select the option "Secondary installation" in the installer (I think, in the second screen of the installer). In the next screen you must specify a folder for your user settings - I have a d:\LazConfigs with subfolders for each version (e.g. d:\LazConfigs\Laz2.0.12-fpc3.2.0-32bit, d:\LazConfigs\Laz2.0.12-fpc3.2.0-64bit, etc). Deny the question to register file types in the Windows registry because you never can be sure that the version of Lazarus that you have in mind opens the double-clicked pas or project file).
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Zvoni

  • Hero Member
  • *****
  • Posts: 627
Re: Lazarus version 2.0.12 under 32-bit win can't compile anything.
« Reply #2 on: March 18, 2021, 04:11:55 pm »
I agree with WP:
Have the same setup here (Win10-64Bit running 32-Bit Laz2.0.12/FPC3.2.0).
No Problems whatsoever.
Installation from official setup-files pointed to by wp
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircraft

Bart

  • Hero Member
  • *****
  • Posts: 4342
    • Bart en Mariska's Webstek
Re: Lazarus version 2.0.12 under 32-bit win can't compile anything.
« Reply #3 on: March 18, 2021, 04:25:42 pm »
Cross-compiling from win32 to win64 is ridiculously easy when you have a setup with just Lazarus 32 bit installed.
All you need to do is install the win32 to win64 fpc cross compiler.
For fpc 3.2 this would be fpc-3.2.0.i386-win32.cross.x86_64-win64.exe.

When you run the installer, tell it to install in the same folder as your current fpc 3.2 compiler.

After that, from within Lazarus you can select (in Project->Compiler Options, (Shift-F11 is the shortcut IIRC)) to compile for Windows-64 with X86_64 processor.
It is as easy as that.

If you need to do this regularly, then make a build mode for Win64 (and include that in your default compiler options for Lazarus). Then you can select  the correct target with a simple mouse click.

Bart

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7271
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus version 2.0.12 under 32-bit win can't compile anything.
« Reply #4 on: March 18, 2021, 05:07:26 pm »
You "cross compile to win 32 bits"

So that means you downloaded
   lazarus-2.0.12-fpc-3.2.0-win64.exe
from (the "Lazarus Windows 64" folder)
   https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.12/

And then you downloaded
   lazarus-2.0.12-fpc-3.2.0-cross-i386-win32-win64.exe

You installed the first, into an empty folder?
While installing over an existing installation works in 99% of all cases, that is not guaranteed.
Keeping and upgrading previous config does work.


You then installed the 2nd into the same folder as the first?
You may have gotten a warning, that the folder was not empty. That must be ignored. (Known issue, but needs time....)





If that is the case, then you created a new project.

In "project options" under target, you did change the following two entries
- Target OS: win32
- Target CPU: i386



installing over an existing installation

If you did install over an existing installations you may be able to fix this, with either of the following 2 methods.

1) Menu: Tools > Configure build lazarus
Make sure to check "Clean all" and then hit build.

2) In the windows explorer, in you install directory, search for files.
  search for *.ppu 
  search for *.o
Both times sort the result list by "type" and delete all files with the exact extension .ppu and .o 
(there are other files found (like .obj) that should be kept)



If the above does not help, then right click the "messages window" (where the error is shown), and from the context menu select
  copy > copy all/original messages to clipboard
Then paste and post the content here.

JuJu

  • Newbie
  • Posts: 2
Re: Lazarus version 2.0.12 under 32-bit win can't compile anything.
« Reply #5 on: March 18, 2021, 08:59:55 pm »
[...]
installing over an existing installation

If you did install over an existing installations you may be able to fix this, with either of the following 2 methods.

1) Menu: Tools > Configure build lazarus
Make sure to check "Clean all" and then hit build.

For an unknown reason this solved the issue and the 32 bit version of Lazarus on the 32 bit Windows could now compile everything. So thank you kindly, good Sir  ::)

If you may allow me the question: What part in the installation, did I screw up? I kinda want to learn from mistakes.


You "cross compile to win 32 bits"

So that means you downloaded
   lazarus-2.0.12-fpc-3.2.0-win64.exe
from (the "Lazarus Windows 64" folder)
   https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.12/

And then you downloaded
   lazarus-2.0.12-fpc-3.2.0-cross-i386-win32-win64.exe

You installed the first, into an empty folder?
While installing over an existing installation works in 99% of all cases, that is not guaranteed.
Keeping and upgrading previous config does work.

You then installed the 2nd into the same folder as the first?
You may have gotten a warning, that the folder was not empty. That must be ignored. (Known issue, but needs time....)

If that is the case, then you created a new project.

In "project options" under target, you did change the following two entries
- Target OS: win32
- Target CPU: i386

[...]

Yes, I did that. I also installed it in the same folder, because I thought it would have to be there, despite the warning and it didn't destroy the Win 64 compiling. It still works great. But the error, that win32 with the i386 processor family is no valid target did also continue to appear. And because I'm too stupid to understand all the compiler settings, I then decided to install a 32 bit Lazarus version on a 32-bit Windows. And try my luck importing the project from one Lazarus to another. The error appeared and I tried to compile an empty form and afterwards an example. Reinstalling didn't fix it, I probably screwed up there too. That is when I lost heart and decided to join the forum.

I also want to apologize, for not being clear in the first post, to everybody else.

Thank you all again for your kind and fast help.

Have a nice day!

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 561
  • Professional amateur ;-P
Hey all,

I'm really sorry to butt in, I really am, but does it have to be this complicated when we have fpcupdeluxe that will do all the heavy lifting for us?

I mean, yeah you can do it like that and you have, what? One native and one cross? That's it?

With fpcupdeluxe you can have 1 native and as many combinations of cross your heart desires.
With fpcupdeluxe you can have any combination of versions AND any combination of cross.
I mean, after DonAlfredo got fpcupdeluxe out, why bother with anything else?

In my case, Ubuntu 20.10 64b, I have the following:
  • $HOME/FreePascal - Lazarus and Free Pascal trunk Linux 64b
    • Cross compile to Linux 32b
    • Cross compile to Linux arm (Raspberry Pi)
    • Cross compile to Windows 64b
    • Cross compile to Windows 32b
    • Cross compile to embed avr (Arduino platform)
  • $HOME/FreePascal_stable - Lazarus and Free Pascal stable Linux 64b
    • Cross compile to Linux 32b
    • Cross compile to Linux arm (Raspberry Pi)
    • Cross compile to Windows 64b
    • Cross compile to Windows 32b
    • Cross compile to embed avr (Arduino platform)
  • $HOME/FreePascal_2.0.12 - Lazarus 2.0.12 and Free 3.2.0 Pascal Linux 64b
    • Cross compile to Linux 32b
    • Cross compile to Linux arm (Raspberry Pi)
    • Cross compile to Windows 64b
    • Cross compile to Windows 32b
  • $HOME/FreePascal_2.0.10 - Lazarus 2.0.10 and Free 3.2.0 Pascal Linux 64b
    • Cross compile to Linux 32b
    • Cross compile to Linux arm (Raspberry Pi)
    • Cross compile to Windows 64b
    • Cross compile to Windows 32b
  • $HOME/FreePascal_2.0.6 - Lazarus 2.0.6 and Free 3.0.4 Pascal Linux 64b
    • Cross compile to Linux 32b
    • Cross compile to Linux arm (Raspberry Pi)
    • Cross compile to Windows 64b
    • Cross compile to Windows 32b

And it took me about 10m to 15m per any one of those folders to get to that stage. And that's because I have, both, a very crappy INet and CPU.

Isn't this a lot more efficient?

Cheers,
Gus
Lazarus 2.3.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7271
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus version 2.0.12 under 32-bit win can't compile anything.
« Reply #7 on: March 18, 2021, 10:12:20 pm »
[...]
installing over an existing installation

If you did install over an existing installations you may be able to fix this, with either of the following 2 methods.

1) Menu: Tools > Configure build lazarus
Make sure to check "Clean all" and then hit build.

For an unknown reason this solved the issue and the 32 bit version of Lazarus on the 32 bit Windows could now compile everything. So thank you kindly, good Sir  ::)

If you may allow me the question: What part in the installation, did I screw up? I kinda want to learn from mistakes.

I can not say for 100% sure how you got into the error. Especially if you installed into a new folder.

But a bit of background why it happens.

Each pascal file (SomeUnit.pas) will be compiled into SomeUnit.ppu and SomeUnit.o
The 2 resulting files, are only readable to the exact same version of the compiler.
- Fpc 3.2 can not read fpc 3.0.4 or 3.3.1 ppu files, and vice versa
- 32 bit fpc can not read 64 bit fpc ppu files and vice versa.
So when you upgrade, and an old ppu remains in the folder (because maybe the new replacement ppu goes into a different subfolder), then that one old ppu will cause issues.
Rebuilding the IDE with "clean all" usually (rules are bit more complex) finds any ppu file (including such old ones) and removes them.


The other cause for issues like this, is if users edit the "path" settings in the project options (or in package options).
But I do not think you did that, because the "Compile IDE fix" does not help for this.
Sometimes users include units from a package by adding the path. That can lead to ppu files being created twice, in the package and in the project dir. Then only one gets updated, and the outdated one causes problems. (even if the compiler is the same)
The IDE will warn in most cases, if a user attempts to add such paths. But it might not catch every case.



In conclusion:

One of your ppu files was broken (old, outdated, wrong sub folder, or simply corrupted (disk error, antivirus, compiler terminated while writing it)). The exact reason is hard to determinate.
Rebuilding the IDE, did fix that.

Note in some cases you might have to remove the ppu using the search in the explorer.
Missing ppu will be rebuild. (unless they have copies, but in other folders, but if you delete those too, then they will be rebuild)

Only if you have a closed source 3rd party package (that you bought), then this may not ship sources but ppu only => such ppu can not be rebuild (missing source).




 

TinyPortal © 2005-2018