Recent

Author Topic: Porting a Windows application from lazarus to be compiled with fpc on Linux  (Read 3728 times)

karlsplatzo

  • New Member
  • *
  • Posts: 20
I have a couple of applications I'd like to be able to run on Linux that have been written using Linux on Windows 64. This is what I understand is possible under the write once compile anywhere tag of Lazarus and FPC.

I'd like to use FPC for compilation as my linux machine is a cluster with no native GUI and so I'm working through Xming, SSH etc.

I have FPC 2.2.0 on the linux machine at the moment but my Win64 version of Lazarus is 1.0.08 using FPC 2.6.2. I'm guessing I'll have to upgrade FPC on the linux box to be compatible.

My questions:
1. Is there a good FAQ for porting and compiling natively (I'm not going to try cross-compiling at this stage), particularly with FPC.
2. It seems obvious I'll need an upgrade of FPC but would a console application be backwards compatible at all?
3. Is it simply better to use Lazarus on the linux box? I'm not admin and installation/upgrades will take time.

Thanks in advance,
Karl


karlsplatzo

  • New Member
  • *
  • Posts: 20

2. It seems obvious I'll need an upgrade of FPC but would a console application be backwards compatible at all?

I've answered the 2nd question myself. For one of my simpler codes, it was straightforward to turn the GUI into a console program which compiles nicely. However, the original GUI version had at least one item that was not recognized by FPC so an upgrade is necessary or I'm stuck with consoles.

Laksen

  • Hero Member
  • *****
  • Posts: 754
    • J-Software
2.2.0 is about 6 years old...

There could be loads of bugs in that version. You should really get a newer version

jarto

  • Full Member
  • ***
  • Posts: 106
1. There's a Multiplatform Programming Guide, that gives some good advice: http://wiki.freepascal.org/Multiplatform_Programming_Guide

2. A console app can be backwards compatible with 2.2.0 pretty well but I don't think it's worth the trouble as upgrading FPC is pretty easy.

3. I do use Lazarus on both Linux and Windows. There's not much of a difference but I have a feeling that the Windows-version is a bit better.

karlsplatzo

  • New Member
  • *
  • Posts: 20
Thanks Jarto.

I have now had Lazarus installed on my linux box.

Is it correct that I can start lazarus from the command line by typing "lazarus"? I'm having trouble finding the documentation on that but that isn't working for me.


geno

  • Full Member
  • ***
  • Posts: 198
Quote
Is it correct that I can start lazarus from the command line by typing "lazarus"? I'm having trouble finding the documentation on that but that isn't working for me.

You should be able to use "startlazarus" 

      regards,
           geno
version:      Lazarus 1.9   FPC 3.0.4
   
widget set:  x-86_64-linux-gtk 2
OS:             ArchLinux/ Xfce 4.12

 

TinyPortal © 2005-2018