Recent

Author Topic: Lazarus on Linux but Target OS=Win64 and CPU=x86_64  (Read 403 times)

Sakkie

  • New member
  • *
  • Posts: 9
  • One love
Lazarus on Linux but Target OS=Win64 and CPU=x86_64
« on: April 24, 2025, 10:52:08 am »
I have been developing apps on Windows 10 and have just switched to Linux (Zorin to be specific). All my apps compile fine and run in the Linux environment but when I change the target OS to Win64 and CPU to x86_64 I get the error:

Quote
The project uses target OS=win64 and CPU=x86_64.
The system.ppu for this target was not found in the FPC binary directories.
Make sure fpc is installed correctly for this target and the fpc.cfg contains the right directories.

I understand the error but I don't know how to fix it. May someone please guide me.

I have installed all the packages that are listed as necessary but I can't find how to install fpcupdeluxe itself. What am I missing?
« Last Edit: April 24, 2025, 01:01:59 pm by Sakkie »

dbannon

  • Hero Member
  • *****
  • Posts: 3352
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus on Linux but Target OS=Win64 and CPU=x86_64
« Reply #1 on: April 24, 2025, 01:42:16 pm »
https://wiki.freepascal.org/Cross_compiling_for_Windows_under_Linux

Although, if you have been using fpcupdeluxe, no idea if it has done some or all of this. Better check before overwriting.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Sakkie

  • New member
  • *
  • Posts: 9
  • One love
Re: Lazarus on Linux but Target OS=Win64 and CPU=x86_64
« Reply #2 on: April 24, 2025, 01:48:11 pm »
Thank you so much Davo.

This looks like it's the answer to my question. I will update you later.

TRon

  • Hero Member
  • *****
  • Posts: 4371
Re: Lazarus on Linux but Target OS=Win64 and CPU=x86_64
« Reply #3 on: April 24, 2025, 04:05:32 pm »
Although, if you have been using fpcupdeluxe, no idea if it has done some or all of this. Better check before overwriting.
Depends whether or not you already installed a (cross-)compiler on the first setup. If only used the install button on main window (for FPC or FPC&laz combo) then the answer would be no.

The good news is you can install a cross-compiler (tab cross) using the same install path in which case FPCUpdeluxe will update the existing FPC installation with the (selected) cross-compiler.

Basically all tha FPCup does is add the ppc cross compiler (when required/missing for the target) and the (cross-)compiled units to the units directory. Oh, and it probably updates the fpc.cfg so that it is able to locate the compiled units.

When done, selecting the target (cpu/platform) in Lazarus for a project should be enough though the used components will need to be (cross-)compiled for chosen target as well so that the first build for the project might be a bit slow.

Wen not using FPCUpDeluxe things are a bit more complicated depending on how FPC was installed and setup/configured. Without that knowledge all that can be said is to do the same as FPCUpdeluxe does but manually.

The wiki describes the manual steps that can be used but the order in which is done where and what to do with the result can be a bit cumbersome to understand for the reader (if you've done it once you'll most probably get/understand it). Always be prepared to ruin your existing setup (so make backups for the important bits in case you care).  :)
« Last Edit: April 24, 2025, 04:10:53 pm by TRon »
Today is tomorrow's yesterday.

Sakkie

  • New member
  • *
  • Posts: 9
  • One love
Re: Lazarus on Linux but Target OS=Win64 and CPU=x86_64
« Reply #4 on: April 24, 2025, 09:38:12 pm »
https://wiki.freepascal.org/Cross_compiling_for_Windows_under_Linux

Although, if you have been using fpcupdeluxe, no idea if it has done some or all of this. Better check before overwriting.

Davo

Thanks a lot. I have followed the steps as outlined in the article and everything works perfectly.

What I would caution anyone who has the same problem I had is that the first time you compile your project the target OS must the default (Linux). Only after this first compilation can you change the target OS. If you start the other way around you might have problems when you continue with the development under Linux as the project breaks. This is what I discovered when I was testing different scenarios. I am not knowledgeable enough to understand why this is.

Thanks once again Davo.

Sakkie

  • New member
  • *
  • Posts: 9
  • One love
Re: Lazarus on Linux but Target OS=Win64 and CPU=x86_64
« Reply #5 on: April 24, 2025, 09:42:30 pm »
Although, if you have been using fpcupdeluxe, no idea if it has done some or all of this. Better check before overwriting.
Depends whether or not you already installed a (cross-)compiler on the first setup. If only used the install button on main window (for FPC or FPC&laz combo) then the answer would be no.

The good news is you can install a cross-compiler (tab cross) using the same install path in which case FPCUpdeluxe will update the existing FPC installation with the (selected) cross-compiler.

Basically all tha FPCup does is add the ppc cross compiler (when required/missing for the target) and the (cross-)compiled units to the units directory. Oh, and it probably updates the fpc.cfg so that it is able to locate the compiled units.

When done, selecting the target (cpu/platform) in Lazarus for a project should be enough though the used components will need to be (cross-)compiled for chosen target as well so that the first build for the project might be a bit slow.

Wen not using FPCUpDeluxe things are a bit more complicated depending on how FPC was installed and setup/configured. Without that knowledge all that can be said is to do the same as FPCUpdeluxe does but manually.

The wiki describes the manual steps that can be used but the order in which is done where and what to do with the result can be a bit cumbersome to understand for the reader (if you've done it once you'll most probably get/understand it). Always be prepared to ruin your existing setup (so make backups for the important bits in case you care).  :)

Thanks TRon, this has helped me to understand a bit better what is going on.

 

TinyPortal © 2005-2018