DelphiFeeds.com

  • Dashboard
  • Popular Stories
  • Trending Stories
  • Feeds
  • Login
Trending now

Using Apilayer REST APIs from Delphi

Using Apilayer REST APIs from Delphi

Delphi Offers Massive Productivity Boost Over WPF And Electron

7 Tips For Learning To Build Powerful Windows GUI Apps Using Python And Delphi

Create Enterprise-Grade Grid Based Desktop Applications 10x Faster With X-Files Components

Quickly Learn How To Fetch A Table Using FireDAC In This IFDPhysCommand Delphi Sample

Tutorial: Introduction To C++ Parallel Compilation With TwineCompile

Easily Integrate Exception Handling Into Your Python GUI Apps Through Delphi

Delphi debugging tip: keep an eye on a object field of an object that will ...

Distinguer les processeurs Intel des processeurs Apple Silicon depuis nos programmes

Powerful Award-Winning Windows UI Toolkit For Delphi And C++Builder

Quickly Access Windows System Info In Your Delphi Application With Excellent Component Suite

Build Visual Stunning Apps Faster With Less Code Using RAD Studio Architect Edition

Introduction To Modern C++ With Tutorials

TMS WEB Core for Visual Studio Code v1.2 released!

Crosscompiling with Lazarus 1.8 on Linux Mint 18.3

1
Serg Serg 3 years ago in Crosscompiling, Lazarus, linux, Mint, Uncategorized 0

Suppose you installed Lazarus 1.8 on Linux Mint 18.3 as described before and want to build Windows binaries (well we don’t like Windows, but the users do 🙂 ). I’ve found the useful piece of information about crosscompiling here and started to adopt it to my 32-bit Linux system.

The first step is to build and install the crosscompiler. For the demonstration purposes I decided to build Win32 crosscompiler (the Win64 case should not be much different).

Lazarus 1.8 uses FPC version 3.0.4, so to perform the first step open up Terminal and execute following commands:

# Navigate to the fpc source folder.
cd /usr/share/fpcsrc/3.0.4

# Compile the cross-compiler.
sudo make clean all OS_TARGET=win32 CPU_TARGET=i386

# Install the cross-compiler.
sudo make crossinstall OS_TARGET=win32 CPU_TARGET=i386 INSTALL_PREFIX=/usr

# Link the cross-compiler and place the link where Lazarus can see it.
sudo ln -sf /usr/lib/fpc/3.0.4/ppcross386 /usr/bin/ppcross386

Now let us open Lazarus and create a simple GUI project. I dropped a button on the form and written OnClick handler:

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage('Hello World!');
end;

I created subfolder /Projects/Lazarus/HelloWorldGUI in my home folder and saved the project under the name HelloW. You can build and run the project and see it works.

Now time to configure the project for Win32 crosscompiling. Open Project Options dialog (Ctrl-Shift-F11). You should see this:

Options0

Check Build Modes checkbox:

Options1

and click the ellipsis button; a new dialog appears:

BuildMode0

Click plus button to create a new build mode, and name it Win32:

BuildMode1

Now we should tell Lazarus to compile Win32 code for this build mode. Select Config and Target on the left panel and select Win32 as target OS:

ConfigWin32

Now you can build the project. I simply clicked green Run button and obtained the warning window:

DebugErr

Well I guess one can’t expect to debug Win32 binary on Linux. Still the work was done, and I’ve found HelloW.exe file in the project folder. To be sure I’ve copied the file on 64-bit Windows 10 system, and It Works!

CrossWin32

Trending Stories

  • Using Apilayer REST APIs from Delphi

  • Delphi Offers Massive Productivity Boost Over WPF And Electron

  • 7 Tips For Learning To Build Powerful Windows GUI Apps...

  • Create Enterprise-Grade Grid Based Desktop Applications 10x Faster With X-Files...

  • Quickly Learn How To Fetch A Table Using FireDAC In...

Embarcadero GetIt

  • Brook Framework

    Microframework which helps to develop web Pascal applications.

  • Trial - TMS Scripter

    Add the ultimate flexibility and power into your apps with native Pascal or Basic scripting and […]

  • Trial - TMS VCL Chart

    DB-aware and non DB-aware feature-rich charting components for business, statistical, financial […]

  • Trial - TMS VCL Cloud Pack

    TMS VCL Cloud Pack is a Delphi and C++Builder component library to seamlessly use all major cloud […]

  • Trial - TMS VCL UI Pack

    Create modern-looking & feature-rich Windows applications faster with well over 600 components […]

  • Learn Delphi Programming
  • Learn C++
  • Embarcadero Blogs
  • BeginEnd.net
  • Python GUI
  • Firebird News
  • Torry’s Delphi Pages
Copyright DelphiFeeds.com 2021. All Rights Reserved
Embarcadero
Login Register

Login

Lost Password

Register

Lost Password