[SOLVED] 64 bit/32 bit problem lazarus / 21-General ---------------------------------------------------------------------- Badger · 2021-01-09 06:59 My computer is 64 bit operating system and x64 bit-based processor running Windows 10 Home.  For my most recent programs the Compiler Options/Target platform options are all set to Default.  Naturally, my programs run as 64 bit exe's. My friend needs to run the program but has a pc running Windows 10 Pro. but the OS is 32 bit with x64-based processor.  Before establishing his OS we got a message something like - File won't run on this computer. I do realise that 64 bit exe's won't run on 32 bit systems. A couple of questions:- 1 - Can I compile using Target platform options Win32/i386/ etc or do I have to install and use the 32 bit lazarus. 2 - So that other people can use the program, should I provide a 32 and 64 bit exe or is it good enough to simply supply a 32 bit exe. ---------------------------------------------------------------------- 440bx · 2021-01-09 07:21 Quote from: Badger on January 09, 2021, 07:59:53 am1 - Can I compile using Target platform options Win32/i386/ etc or do I have to install and use the 32 bit lazarus. 2 - So that other people can use the program, should I provide a 32 and 64 bit exe or is it good enough to simply supply a 32 bit exe. 1.  You don't need the 32bit version of Lazarus, you can keep using the 64bit version. Simply setting the option to Win32 is enough.  You don't even need to set the CPU to i386, leave it as x86_64. 2. For the time being 32bit programs will run under all desktop version of Windows, that will change only if and when MS decides to drop 32bit support in their 64bit Windows, that's not likely to happen soon.   A 32bit program will run slower when executed by a 64bit version of Windows but, in many cases the difference is small (though that is highly dependent on what the program does.)  IOW, a 32bit program will run on any version of Windows but a 64bit program will run faster than the same 32bit program executed on a 64bit Windows. ---------------------------------------------------------------------- bb84000 · 2021-01-09 08:59 Hello, Quote from: Badger on January 09, 2021, 07:59:53 amCan I compile using Target platform options Win32/i386/ etc or do I have to install and use the 32 bit lazarus. If you have installed Lazarus 64bit (lazarus-2.0.10-fpc-3.2.0-win64.exe), install lazarus i386 32bit cross compiler(lazarus-2.0.10-fpc-3.2.0-cross-i386-win32-win64.exe). You can compile a 32bit-i386 application for computers using Windows 32 bit on a 32 bit CPU, along with a 64 bit-x86_64 application. The choose of 32 bit and 64 bit install can be done by the installer. bb ---------------------------------------------------------------------- PascalDragon · 2021-01-09 10:33 Quote from: 440bx on January 09, 2021, 08:21:47 amQuote from: Badger on January 09, 2021, 07:59:53 am1 - Can I compile using Target platform options Win32/i386/ etc or do I have to install and use the 32 bit lazarus. 2 - So that other people can use the program, should I provide a 32 and 64 bit exe or is it good enough to simply supply a 32 bit exe. 1.  You don't need the 32bit version of Lazarus, you can keep using the 64bit version. Simply setting the option to Win32 is enough.  You don't even need to set the CPU to i386, leave it as x86_64. Not quite. The cross compiler from x86_64-win64 to i386-win32 needs to be installed as bb84000 explained. ---------------------------------------------------------------------- 440bx · 2021-01-09 10:54 Quote from: PascalDragon on January 09, 2021, 11:33:32 amNot quite. The cross compiler from x86_64-win64 to i386-win32 needs to be installed as bb84000 explained. You're right. I forgot that the cross compiler needs to be installed too. ---------------------------------------------------------------------- Badger · 2021-01-17 02:31 It all seemed so easy! Having a few problems with the above advice. 1.  If I try to set Program Options/Config and Target to Win 32 and i386 as suggested by bb84000, I get a message that FPC 3.0.4 for 64 bit is not supported.  I can live with that. 2. If I try to set target to Win 32 and default Target CPU Family I get an error message 'The current FPC has no config file. It will probably miss some units.  Check your installation of FPC.  On clicking OK, I get error message 'The project uses target OS=win32 and CPU x84_64.The system.ppu for this target was not found in the FPC binary directories  Make sure the fpc is installed correctly for this target and the fpc.cfg contains the right directories. Can I get some 'easy to understand' advice please ---------------------------------------------------------------------- Badger · 2021-02-03 01:36 Sorry for the delay in getting back.  The world doesn't stand still for part time programmers! Thanks for the advice jamie.  The problem is I will need to compile the program for platforms other than windows based so, not having access to a Mac, I will need to cross-compile.  So I am back to the problem I raised a while ago Quote2. If I try to set target to Win 32 and default Target CPU Family I get an error message 'The current FPC has no config file. It will probably miss some units.  Check your installation of FPC. On clicking OK, I get error message 'The project uses target OS=win32 and CPU x84_64.The system.ppu for this target was not found in the FPC binary directories  Make sure the fpc is installed correctly for this target and the fpc.cfg contains the right directories. Any advice? ---------------------------------------------------------------------- AL · 2021-02-03 02:13 Quote from: bb84000 on January 09, 2021, 09:59:39 amHello, Quote from: Badger on January 09, 2021, 07:59:53 amCan I compile using Target platform options Win32/i386/ etc or do I have to install and use the 32 bit lazarus. If you have installed Lazarus 64bit (lazarus-2.0.10-fpc-3.2.0-win64.exe), install lazarus i386 32bit cross compiler(lazarus-2.0.10-fpc-3.2.0-cross-i386-win32-win64.exe). You can compile a 32bit-i386 application for computers using Windows 32 bit on a 32 bit CPU, along with a 64 bit-x86_64 application. The choose of 32 bit and 64 bit install can be done by the installer. bb Have you installed the cross compiler as quoted? ---------------------------------------------------------------------- dseligo · 2021-02-03 07:14 Why not use fpcdeluxe https://wiki.freepascal.org/fpcupdeluxe for that? ---------------------------------------------------------------------- Zoran · 2021-02-03 09:45 Quote from: Badger on February 03, 2021, 02:36:18 am not having access to a Mac, I will need to cross-compile. Cross-compiling for targets on which you cannot test the programme's behaviour will solve nothing. ---------------------------------------------------------------------- Badger · 2021-02-06 03:13 QuoteHave you installed the cross compiler as quoted? Went back and upgraded to latest Lazarus and FPC and it is now Working. QuoteCross-compiling for targets on which you cannot test the programme's behaviour will solve nothing.Isn't the ability to cross compile to other platforms one of the advantages of Lazarus? (Anyone in Tasmania got an old Mac I can borrow for a few months?) ---------------------------------------------------------------------- PascalDragon · 2021-02-06 15:24 Quote from: Badger on February 06, 2021, 04:13:51 amQuoteCross- compiling for targets on which you cannot test the programme's behaviour will solve nothing.Isn't the ability to cross compile to other platforms one of the advantages of Lazarus? (Anyone in Tasmania got an old Mac I can borrow for a few months?) But cross-compiling is only part of the solution. You also need to test whether your application behaves as expected or as a user of that platform might expect. Or if there are problems that aren't covered by simple compilation checks (e.g. path differences). ---------------------------------------------------------------------- Badger · 2021-02-09 06:20 Sorry PascalDragon, I was being tongue-in-cheek.  I will use a Mac cross compile for a couple of very simple programs and hope for the best.  I'll  just have to see what Father Christmas  manages for my larger work. Thanks all for your help.