Recent

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

Saylo_49

  • New Member
  • *
  • Posts: 43
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: 8746
  • 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: 4219
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/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

af0815

  • Hero Member
  • *****
  • Posts: 1289
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: 1312
    • 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

  • Hero Member
  • *****
  • Posts: 532
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 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

 

TinyPortal © 2005-2018