Recent

Author Topic: [INFO] Lazarus Installation Guide to Cross-Compile Windows 32/64-bit  (Read 1684 times)

jasc2v8

  • New member
  • *
  • Posts: 37
Summary:
  • I'm new to Lazarus and FPC and I am loving it!
  • I have read many posts in many places to figure this out.
  • This post is to help others with current information.

Lazarus Installation Guide to Cross-Compile Windows 32/64-bit
-----------------------------------------------------------------------

Download the installers from sourceforge.net  (click on the Files tab):
   https://sourceforge.net/projects/lazarus/

The installers include FPC and the Lazarus help files:
   Lazarus 32-bit
      lazarus-1.8.2-fpc-3.0.4-win32.exe
      lazarus-1.8.2-fpc-3.0.4-cross-x86_64-win64-win32.exe
   Lazarus 64-bit
      lazarus-1.8.2-fpc-3.0.4-win64.exe
      lazarus-1.8.2-fpc-3.0.4-cross-i386-win32-win64.exe

To install Lazarus 32-bit, and cross-compile a Windows 64-bit exe:
   1. Install the win32.exe
   2. Install the cross-x86_64-win64-win32.exe in the same folder

To install Lazarus 64-bit, and cross-compile a Windows 32-bit exe:
   1. Install the win64.exe
   2. Install the cross-i386-win32-win64.exe in the same folder

The following assumes Lazarus 64-bit with cross-i386-win32-win64
---------------------------------------------------------------------------

To cross-compile 32-bit or 64-bit without creating Build Modes:
   Project, Options, Compiler Options, Config and Target:
      Target OS             =Default=Win64  or Win32 for 32-bit
      Target CPU family =Default=x86_64 or i386  for 32-bit
      Target processor   =Default
   Press OK to exit Project Options
   Build and run the project
   Use Windows Task Manager, Details tab, to see if Project exe is 32/64-bit
   
To Configure Build Modes:
   Project, Options, Compiler Options, Config and Target:
      Check 'Build Modes', then press the [...] button
         Press [Create Debug and Release Modes] button
         Press OK
         
   Create a Debug 32-bit Build Mode:
      Lazarus menu: Project, Options, Compiler Options, Config and Target
      Select Build Mode = Debug
      Press the Build Modes [...] button
         Click to select Debug on the list
         Press the [ + ] button to add a new build mode
         Rename to 'Debug 32-bit', press OK
      Set Target Platform to 32-bit:
         Target OS            =Win32
         Target CPU family =i386
         Target processor   =Default
      Press OK to exit Project Options and save Build Mode 'Debug 32-bit'
      
   Create a Debug 64-bit Release Mode:
      Lazarus menu: Project, Options, Compiler Options, Config and Target
      Select Build Mode = Release
      Press the Build Modes [...] button
         Click to select Release on the list
         Press the [ + ] button to add a new build mode
         Rename to 'Release 32-bit', press OK
      Set Target Platform to 32-bit:
         Target OS             =Win32
         Target CPU family =i386
         Target processor   =Default
      Press OK to exit Project Options and save Build Mode 'Release 32-bit'      
   Build and run the project
   Use Windows Task Manager, Details tab, to see if Project exe is 32/64-bit

To use Build Modes:
   Lazarus IDE Menu: Change Build Mode dropdown (left of Run button)
   Build and run the project
   Use Windows Task Manager, Details tab, to see if Project exe is 32/64-bit