Recent

Author Topic: Targetting Linux from Windows...?  (Read 12077 times)

KillerCode

  • New Member
  • *
  • Posts: 29
Targetting Linux from Windows...?
« on: December 22, 2010, 07:16:34 am »
ive looked alot for this one, but most of what i found was compiling lazarus itself to work on a linux box..

i was wondering if its possible to compile Linux executables while im still on windows? so lazarus produces windows and linux executables while im still on windows.

thanks...

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12770
  • FPC developer.
Re: Targetting Linux from Windows...?
« Reply #1 on: December 22, 2010, 09:14:36 am »
It is possible, but it is in general only worthwhile for people deep into crosscompiling. It also needs libraries copied from the target Linux installation to the Windows machine.

Since you have to install Linux either way, one might as well compile under Linux.

The build faq has a few pointers and background info about crosscompiling. If you persist, read it a few times back to back.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Targetting Linux from Windows...?
« Reply #2 on: December 22, 2010, 04:57:04 pm »
The other way around is much simpler since you don't need any kind of difficult setup. Just recompile RTL, FCL, LCL (+all required 3rd party packages / libraries) for Win and you can compile for it from Lin.

KillerCode

  • New Member
  • *
  • Posts: 29
Re: Targetting Linux from Windows...?
« Reply #3 on: December 23, 2010, 11:51:50 am »
too hard for me to move totally to linux, what about producting 64bit windows executables from 32bit windows?
is it possible? or i need 64bit machine for that too?

Laksen

  • Hero Member
  • *****
  • Posts: 802
    • J-Software
Re: Targetting Linux from Windows...?
« Reply #4 on: December 23, 2010, 12:01:35 pm »
That is possible

KillerCode

  • New Member
  • *
  • Posts: 29
Re: Targetting Linux from Windows...?
« Reply #5 on: December 23, 2010, 12:25:12 pm »
how can i do it?

mmab

  • Jr. Member
  • **
  • Posts: 89
Re: Targetting Linux from Windows...?
« Reply #6 on: December 23, 2010, 02:50:11 pm »

you can use virtualization,
download virtualbox from http://www.virtualbox.org/ and install any linux you want to the virtualbox, then install lazarus and compile.


Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Targetting Linux from Windows...?
« Reply #7 on: December 23, 2010, 04:01:27 pm »
Quote
what about producting 64bit windows executables from 32bit windows?
is it possible? or i need 64bit machine for that too?
In this case, it's as easy as cross compiling from lin32 to win32 I described above. This is because for win32/64, FPC has its own internal linker and Windows PE (.exe) doesn't need the presence of required dlls (it would be searched at runtime by the OS).

KillerCode

  • New Member
  • *
  • Posts: 29
Re: Targetting Linux from Windows...?
« Reply #8 on: December 23, 2010, 07:00:36 pm »
what about from win32 to win64, how can i do that? any tutorial?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Targetting Linux from Windows...?
« Reply #9 on: December 24, 2010, 07:39:18 am »
Quote
what about from win32 to win64, how can i do that? any tutorial?
http://wiki.lazarus.freepascal.org/Cross_compiling#Win32_To_Win64
Please read the foreword as well, and add INSTALL_PREFIX to the make command specifying base fpc folder. e.g.:
Code: [Select]
make OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=c:/lazarus/fpcNote that you'll need full fpc source since you need to build the cross compiler as well (instead of just the units). Last stable lazarus installer I use only have 'packages' and 'rtl' folder under source directory.

yoga

  • Newbie
  • Posts: 3
Re: Targetting Linux from Windows...?
« Reply #10 on: December 28, 2010, 05:11:36 am »

you can use virtualization,
download virtualbox from http://www.virtualbox.org/ and install any linux you want to the virtualbox, then install lazarus and compile.




Thank you friend!!

willowbee

  • Newbie
  • Posts: 1
Re: Targetting Linux from Windows...?
« Reply #11 on: January 20, 2011, 09:34:14 pm »
+1  thanks


you can use virtualization,
download virtualbox from http://www.virtualbox.org/ and install any linux you want to the virtualbox, then install lazarus and compile.




Thank you friend!!

jbraelfort

  • Newbie
  • Posts: 1
Re: Targetting Linux from Windows...?
« Reply #12 on: January 26, 2011, 05:21:48 am »
I will have to agree, you should definitely use virualization..  Its very simple to download the virtualbox... Once your done with that just install the lazarus and compile..  Trust me its not hard to do at all..

BlueIcaro

  • Hero Member
  • *****
  • Posts: 834
    • Blog personal
Re: Targetting Linux from Windows...?
« Reply #13 on: January 27, 2011, 04:13:08 pm »
I have W7/64 with lazarus 64, and I have same virtual machines, one with linux, other with linux/64, and other with XP

All VM, with their lazarus, and I use it, for compiling and test my applications.  8)

/BlueIcaro

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: Targetting Linux from Windows...?
« Reply #14 on: January 27, 2011, 04:22:02 pm »
The best thing I can suggest is: http://www.andlinux.org/
Give it a try.

 

TinyPortal © 2005-2018