Cross compiling lazarus / 21-General ---------------------------------------------------------------------- backprop · 2024-11-04 19:59 Cross compiling explanation on wiki seems quite messy. For instance: https://wiki.freepascal.org/Cross_compiling_for_Windows_under_Linux Is it possible to make this much easier? For instance, I would like to make on Linux 64-bit executable for 64/32-bit Linux, Windows and Mac. But all this seems quite messy if I need to change all before any compilation... Perhaps some easier way exists? ---------------------------------------------------------------------- dbannon · 2024-11-04 22:24 Quote from: backprop on November 04, 2024, 08:59:48 pmFor instance, I would like to make on Linux 64-bit executable for 64/32-bit Linux, Windows and Mac. But all this seems quite messy if I need to change all before any compilation... Changes all what ? You do it once and then, in you code, have #ifdef around platform specific code. By the way, I never managed to get Linux->Mac to work. But have not tried for some time.... And, my cross compile machine is a VM, it builds Linux (32 and 65), Windows (32 and 64), Armhf and AppImages. GTK2, Qt5, Qt6, WIn23. By having it as a standalone, rarely changing box, I don't need to worry about the day to day fiddling causing unexpected problems. Its an U2004 machine so it avoids the glibc problem. Davo ---------------------------------------------------------------------- Wallaby · 2024-11-04 23:30 In one word - fpcupdeluxe. Install fixes FPC and fixes Lazarus and the cross-compilers towards target platforms. Plus, you will get all the latest not yet released fixes done to both Lazarus and FPC. I am not sure how well it works on Linux, but from Windows I can easily compile towards Linux (x86_64 + aarch64), Windows (i386 + x86_64) and Darwin (x86_64 + aarch64), all from the same IDE on my Windows PC. ---------------------------------------------------------------------- TRon · 2024-11-04 23:45 If cross-compiling to windows looks messy then I wonder what TS would think about what needs to be done for cross-compiling to some serious platforms. FPCUpdeluxe is nice but only hides that what needs to be done. Practice has proofed that even that isn't enough for some. ---------------------------------------------------------------------- Thaddy · 2024-11-05 10:41 I don't see what is messy? And I have a lot of cross compilers at the same time and all work as expected.