Forum > Windows (32/64)

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

(1/2) > >>

JimD:
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

keleven:
Thanks for that, worked a treat.   :)

I have tried before and got confused, I ended up running two separate installations.

valdir.marcos:

--- Quote from: jasc2v8 on May 04, 2018, 02:47:27 am ---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
--- End quote ---
Thanks.

Could you improve the wiki?
http://wiki.freepascal.org/Cross_compiling#From_win32_to_win64
http://wiki.freepascal.org/Cross_compiling#From_win64_to_win32

Handoko:
Great !

dbannon:

--- Quote from: valdir.marcos on February 11, 2019, 04:07:48 am ---......
Could you improve the wiki?
http://wiki.freepascal.org/Cross_compiling#From_win32_to_win64
http://wiki.freepascal.org/Cross_compiling#From_win64_to_win32

--- End quote ---

+1 from me !  Its a bit of work jasc2v8 but not hard. And actually writing it out, a bit formatted, will help you understand it even better !

Its great to see things like this posted in the forum but most new users poke around in the wiki first and we have a lot of dated stuff in the wiki....

Davo 

Navigation

[0] Message Index

[#] Next page

Go to full version