Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building cross-platform Delphi applications

I downloaded Lazarus, but have worked with Embarcadero Delphi IDE too. I have a question about building cross-platform Delphi applications.

How can I build them under win32 environment? I read the wiki from Lazarus site, that explains how to do it, but I still do not understand it. Is is possible to build and compile application under win32 environment for Linux and MacOS? If it is possible, can someone explain ste-by-step how to do it exactly.

EDIT: Now is the time for talking about the new XE2 version of the Delphi IDE I think :)

Thanks

like image 881
evilone Avatar asked Jan 13 '11 05:01

evilone


2 Answers

What you're asking for already exists in the lazarus wiki site, you need to read these articles.

  • Multiplatform Programming Guide
  • Cross compiling
  • Cross compiling for Win32 under Linux
  • How to Write Portable Code (nice doc from Marco van de Voort)
  • Buildfaq
like image 178
RRUZ Avatar answered Oct 19 '22 01:10

RRUZ


While crosscompiling to a non windows target is possible (and not that hard), getting used to fpc/lazarus and crosscompiling in one first step is a bridge too far. This because Linux is not a very homogenous target and dealing with this variation requires some understanding how libraries and linking works on Linux. This defeats one-button downloadable cross-compile setups to "general" linux. I know, such one-button thingies that work out of the box for everyone would be great, but it is just not going to happen (or only forvery limited distribution-version combinations)

Crosscompiling with FPC is not extremely difficult or rocket science, but the amount of jargon and details can flabbergast uninitiated people, and without background knowledge it is hard to diagnose problems as a result of minor misconfigurations

I recommend to first familiarize yourself with Lazarus/FPC, and only then make the crosscompilation leap. (and the already mentioned buildfaq names some reasons).

Bottomline: install lazarus on Windows and start porting your app. If that succeeds, start using a linux install (or VM) to familiarize yourself with Linux, and Lazarus under it. You'll need a linux install anyway to test.

Only then start thinking about crosscompiling to speed up the process.

like image 26
Marco van de Voort Avatar answered Oct 19 '22 00:10

Marco van de Voort