Lazarus

Programming => Operating Systems => Linux => Topic started by: Saylo_49 on April 06, 2019, 08:59:23 pm

Title: compile to linux under windows
Post by: Saylo_49 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

Title: Re: compile to linux under windows
Post by: Leledumbo 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.
Title: Re: compile to linux under windows
Post by: lucamar 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 (http://wiki.freepascal.org/Cross_compiling)
Title: Re: compile to linux under windows
Post by: af0815 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.
Title: Re: compile to linux under windows
Post by: Remy Lebeau 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) (https://docs.microsoft.com/en-us/windows/wsl/about) component, which "is a collection of components that enables native Linux ELF64 binaries to run on Windows."
Title: Re: compile to linux under windows
Post by: mas steindorff on April 10, 2019, 02:35:46 am
Actually, in Windows 10 you can, if you install Microsoft's Windows Subsystem for Linux (WSL) (https://docs.microsoft.com/en-us/windows/wsl/about) 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?