Building cross-platform Delphi applications
Asked Answered
L

3

10

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

Lanza answered 13/1, 2011 at 5:42 Comment(6)
FPC/Lazarus <> Delphi, not matter how compatible it is. Right now you can't build "cross-platform Delphi applications" (IMHO Prims is not Delphi, despite its name...), until Embarcadero delivers its cross-platform product (planned, but not available yet)Shirleenshirlene
Idsadon, that's not what evilone asked.Parsifal
the best place to ask this question would be the Lazarus forum. I am sure that someone from that stie will help you.Rolling
still haven't got any answer that satisfied my needs...Lanza
A discussion of the unreleased XE2 would not be constructive. If you have specific questions after it's released, they'd be worth asking. Reviving an almost 9 month old question to do so is not.Ayana
XE2 uses a new library called FireMonkey for non Windows development, which is not related to VCL/LCL. The XE2 win64 port IS vcl based thoughMorbid
M
6

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.

Morbid answered 15/1, 2011 at 11:33 Comment(0)
V
8

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

Veldaveleda answered 13/1, 2011 at 7:26 Comment(5)
I wrote that I do not understand this lazarus wiki text, and if somebody can explain me it step-by-step. I do not need information how to write cross-platform code, but tutorial about to build for etc linux - that compiled files are not executables, but linux compatible.Lanza
@evilone, some of the links posted already are step by step guides. you must try to follow the instructions and when you have a particular problem you can ask again here in StackOverflow.Veldaveleda
@PRUZ, say you'd like to compile a Linux variant of your application from Windows: The "Cross compiling" link tells you it's a bit tricky, go read the "BuildFaq". The "BuildFaq" authoritative version is the PDF, but that's an scanned document and makes your eyes bleed, so I assume everyone's going to read the HTML version. The HTML version has an short paragraph on how to cross-compile Lazarus itself windows-to-linux, with this lovely warning at the end This should build a Linux lazarus. However most likely, it will bomb out missing some library....Instant
@PRUZ, I appreciate the links as I'm about to fight this problem myself, but the lazarus wiki doesn't actually include the required information to make windows-to-linux cross-compilation possible.Instant
The buildfaq is not scanned at all. No idea how you got that idea.Morbid
M
6

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.

Morbid answered 15/1, 2011 at 11:33 Comment(0)
S
3

CodeTyphon is a powerful Lazarus/FPC one click easy installation package for cross platform native development. It already supports 4 CPU/OS hosts (Win32, Win64, Linux32, Linux64), and 16 CPU/OS targets (arm-Wince, arm-Linux, arm-Embedded, arm-gba, arm-nds, i386-Win32, i386-Linux, i386-FreeBSD, i386-Haiku, x86_64-Win64, x86_64-Linux, x86_64-FreeBSD, powerpc-Linux, powerpc64-Linux, sparc-Linux, sparc-Solaris). More are supported in Lazarus/FreePascal, but others are not yet integrated in CodeTyphon. Did I mention that it is free? One code to rule them all ;-)

The point is that you don't have to waste days for setting up your cross platform environment, since someone has already done the hard work for you.

Shark answered 13/1, 2011 at 11:3 Comment(4)
avra, here it says that 'This Project is licensed as: Freeware.'Parsifal
this project could make your life easier for installing a cross-platform chain using FPC/LazarusEntitle
so if you know so much about that project, please tell me how I can build linux application from windows environment thenLanza
I know about the project just enough for my needs. Haven't you checked the link I gave? From there one of the links leads to pilotlogic.com/codetyphon/help where you have an example of cross building for WinCE (topic "7.1 Cross-Build for WinCE"). It is the same principle for other systems.Shark

© 2022 - 2024 — McMap. All rights reserved.