Recent

Author Topic: Write ones, Compile anywhere in Linux...  (Read 10311 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3716
    • StrumPract is the musicians best friend
Write ones, Compile anywhere in Linux...
« on: January 25, 2011, 08:51:35 pm »
Hello.
Im very impressed by Lazarus.
I write sharewares for Linux and Windows.
Usually i develop in Ubuntu-Linux and compile the source in Linux, then i reboot in Windows and re-compile the same source to have the exe program for Windows.
Yesterday i have installed Lazarus for Windows in Linux via Wine.
And it works perfectly, i can compile the source with Lazarus-Wine, without problems. So i don't need to reboot in Windows to have a Windows exe program.
I can cross compile in Linux !

Whaouw, Lazarus is very powerfull... ;D
  
« Last Edit: January 25, 2011, 08:53:09 pm by fredvs »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: Write ones, Compile anywhere in Linux...
« Reply #1 on: January 25, 2011, 09:51:08 pm »
I need to do that too, is it easy?
how can I install it in Wine? I'm using Ubuntu 9.10

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: Write ones, Compile anywhere in Linux...
« Reply #2 on: January 25, 2011, 10:10:05 pm »
There is many tutorials how to do cross compiling (compiling exe application on linux etc) but I always fail with configure it.
But I found the best way for me. Linux ubuntu is my root system, so I installed virtualbox and created clear virtual systems with lazarus only. I can install as many systems as I need and I don't need reboot main system. So I have windows XP, windows 7 32bit and 64 bit, xubuntu 32/64 bit with GTK interface, kubuntu 32/64 bit with QT interface etc... Each system is as one file, so I can easily manage this or just delete file if I don't need X system anymore. I can compile, run and test application and I'm sure it works on 100%. I keep all virtual machines on my old 80 GB hard disk, so free space it's not a problem. Each system have git client and update project sources from my git server. This is my version of "cross compiling" and I like it :P
« Last Edit: January 25, 2011, 10:15:02 pm by Dibo »

Fred vS

  • Hero Member
  • *****
  • Posts: 3716
    • StrumPract is the musicians best friend
Re: Write ones, Compile anywhere in Linux...
« Reply #3 on: January 25, 2011, 10:15:23 pm »
@ Motaz.
It is hyper simple.
-1 Install Wine (Windows emulator) on your Linux system.
-2 Download the install-Windows-Lazarus-FPC.exe file.
-3 Execute that install-Windows-Lazarus-FPC.exe (dubble click on icon). After install a new icon is added in the Application shortcut (wine>programs>Lazarus).
-4 Go to Applications-Wine-Programs-Lazarus and load >Lazarus for Windows.

Thats all folks.  ;D
« Last Edit: January 25, 2011, 10:26:54 pm by fredvs »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: Write ones, Compile anywhere in Linux...
« Reply #4 on: January 25, 2011, 10:41:48 pm »
I've removed the old version of Wine and installed the latest one (Beta)
and Lazarus windows executable is installed successfully. This is a big step.
but when I add LazReport and recompile Lazarus, it takes long time, it is hanging, I think.
Does it re-compiler successfully in Wine? I mean Lazarus

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: Write ones, Compile anywhere in Linux...
« Reply #5 on: January 25, 2011, 11:11:46 pm »
Now Lazarus compilation is working, and I can use LazReport.
I've compiled one of my applications and I'll test it tomorrow on Windows, to see how does it look like, because it contains Unicode (Arabic language).

Leledumbo

  • Hero Member
  • *****
  • Posts: 8831
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Write ones, Compile anywhere in Linux...
« Reply #6 on: January 26, 2011, 02:02:40 am »
Actually, cross-compiling TO Windows is very easy. You just need to recompile RTL, FCL, and LCL for Windows. After that, you can change the OS target from compiler options menu and you can compile your app directly. I prefer this option since my Linux partition is quite limited in size. Anyway, cross compilation is one of the best feature offered by FPC, so IMHO this should be better supported (if only *nix executables are as easy as Windows', then the opposite would be as simple as this).

Fred vS

  • Hero Member
  • *****
  • Posts: 3716
    • StrumPract is the musicians best friend
Re: Write ones, Compile anywhere in Linux...
« Reply #7 on: January 26, 2011, 04:20:23 am »
By the way...
Is there a emulator like Wine that emulate mac OSX ?
@ Dibo : Have you tried to install mac OSX in virtualbox ?
I would be marvellous to have Lazarus for Mac installed on the same laptop, with Lazarus for Linux and for Windows as well... ::)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Write ones, Compile anywhere in Linux...
« Reply #8 on: January 26, 2011, 04:43:17 am »
@ Dibo : Have you tried to install mac OSX in virtualbox ?

Just so you know, that likely violates Apple's license for OS X to buy a copy of OS X and install it on non-Apple hardware.

There is a way to run OS X, Windows and Linux on the same laptop: it's called a MacBook.

Thanks.

-Phil

avra

  • Hero Member
  • *****
  • Posts: 2566
    • Additional info
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: Write ones, Compile anywhere in Linux...
« Reply #10 on: January 26, 2011, 10:14:37 am »
@ Dibo : Have you tried to install mac OSX in virtualbox ?
Currently, I don't need any projects on MacOS, but I was curious if this is possible. I had 4 different MacOS ISO images. They hang up during installation. One installed successfully, but hung up on first reboot. They are many tutorials about installing MacOS on Virtualbox, so I think I had wrong MacOS or Virtualbox version.
Quote from: avra
For cross compiling, you can try this:
http://www.pilotlogic.com/sitejoom/index.php?option=com_content&view=article&id=96&catid=68&Itemid=147
Hmm I never heard about codetyphon. Looks interesting. My project depends on new Lazarus 0.9.31 from SVN. Can I somehow replace this source and easily update?
« Last Edit: January 26, 2011, 10:21:28 am by Dibo »

DirkS

  • Sr. Member
  • ****
  • Posts: 251
Re: Write ones, Compile anywhere in Linux...
« Reply #11 on: January 26, 2011, 12:00:13 pm »
Quote
They are many tutorials about installing MacOS on Virtualbox, so I think I had wrong MacOS or Virtualbox version.
Virtualbox only supports OSX VM's on Apple hardware with OSX as host. One of the reasons is, as Phil mentions, that it violates Apple's licence to install OSX on non Apple hardware.

Gr
Dirk.

avra

  • Hero Member
  • *****
  • Posts: 2566
    • Additional info
Re: Write ones, Compile anywhere in Linux...
« Reply #12 on: January 27, 2011, 10:27:36 am »
Quote
Hmm I never heard about codetyphon. Looks interesting. My project depends on new Lazarus 0.9.31 from SVN. Can I somehow replace this source and easily update?
I don't see why not, but I haven't tried it myself. I stick to official version and just add docking and some components. Don't forget to use admin if you install it in Vista/Win7.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018