Recent

Author Topic: compile to linux under windows  (Read 712 times)

Saylo_49

  • New Member
  • *
  • Posts: 34
compile to linux under windows
« on: April 06, 2019, 08:59:23 pm »
hello
I am using Lazarus 2.0 . 32 bit in windows 10 - 64b

I saw in wiki (compile without lazarus) that it is possible to compile a project only by using Lazbuild and fpc and lcl (lazarus ide removing is harmless)

So the question is
is it possible to use Fpc for linux (as portable) alongside with lazarus and fpc windows installation

or if possible
if there is a lazarus windows installation to target linux only

Lazarus 2.0.2 - FPC 3.0.4 - Win32

Leledumbo

  • Hero Member
  • *****
  • Posts: 8112
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: compile to linux under windows
« Reply #1 on: April 06, 2019, 09:28:15 pm »
is it possible to use Fpc for linux (as portable) alongside with lazarus and fpc windows installation
Yes
if there is a lazarus windows installation to target linux only
No

Do note that *nix platforms require target libraries to be present at compile time, so to make things easier, you might need to have a copy of /usr/lib directory (that has GTK/QT/whatever development libraries) from a distro that represents minimum Linux installation you expect to work with your compiled binaries.

lucamar

  • Hero Member
  • *****
  • Posts: 2086
Re: compile to linux under windows
« Reply #2 on: April 06, 2019, 09:31:56 pm »
First, you can't use Linux binaries on Windows: you would have to build (or download from somewhere and install) a cross-compiler, cross-binutils, etc. But the worst problem is not really the compiler or the tools: it's the miriad libraries needed that you can't install--at least not easily.

Anyway, look in the wiki: Cross-compiling
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

af0815

  • Sr. Member
  • ****
  • Posts: 360
Re: compile to linux under windows
« Reply #3 on: April 06, 2019, 10:21:24 pm »
You can crosscompile and crossdebug from win to most linux. But you have to understand the differences. This the first part, to create the cross tools a second. Not an easy way.
regards
Andreas

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 675
    • Lebeau Software
Re: compile to linux under windows
« Reply #4 on: April 09, 2019, 09:25:17 pm »
First, you can't use Linux binaries on Windows

Actually, in Windows 10 you can, if you install Microsoft's Windows Subsystem for Linux (WSL) component, which "is a collection of components that enables native Linux ELF64 binaries to run on Windows."
« Last Edit: April 09, 2019, 09:27:20 pm by Remy Lebeau »
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

mas steindorff

  • Sr. Member
  • ****
  • Posts: 428
Re: compile to linux under windows
« Reply #5 on: April 10, 2019, 02:35:46 am »
Actually, in Windows 10 you can, if you install Microsoft's Windows Subsystem for Linux (WSL) component, which "is a collection of components that enables native Linux ELF64 binaries to run on Windows."
I was going to suggest this but how do you access the Linux files from Lazarus running on windows that need to be linked in?
windows 7/10 - laz 2.0 / 1.2.6 general releases