Linux 下的 Delphi 交叉编译器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10109234/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 05:43:55  来源:igfitidea点击:

Delphi cross compiler for linux

windowslinuxdelphidelphi-7

提问by Daniel

I was wondering if there is any Borland cross compiler that can make my windows code work on linux without wine.I'm using winxp with delphi 7. I was always wondering if it was possible to code same tool I coded in windows , again in Linux and how is it possible to code same tool by using pascal code in linux.Thanks

我想知道是否有任何 Borland 交叉编译器可以让我的 windows 代码在没有 wine 的情况下在 linux 上运行。我使用的是带有 delphi 7 的 winxp。我一直想知道是否可以编写我在 windows 中编写的相同工具,再次在Linux 以及如何在 linux 中使用 pascal 代码编写相同的工具。谢谢

采纳答案by cezar

The best solution is Lazarus, the delphi-like GUI for Free Pascal. If you were using "pure" vcl, without Windows internales or any special add-ons the migration will be a pice of cake :) Take a look here: http://lazarus.freepascal.org

最好的解决方案是 Lazarus,它是 Free Pascal 的类似 Delphi 的 GUI。如果您使用的是“纯”vcl,没有 Windows 内部或任何特殊的附加组件,迁移将是小菜一碟:) 看看这里:http: //lazarus.freepascal.org

BTW - Lazarus and FPC are true mulitplatform - you can compile code for Linux, Windows, MacOS and more with the same codebase :)

顺便说一句 - Lazarus 和 FPC 是真正的多平台 - 您可以使用相同的代码库为 Linux、Windows、MacOS 等编译代码:)

回答by David Heffernan

Your only option, if you want a Borland Delphi cross-compiler, is CrossKylix. This isn't a real cross-compiler. Instead you run the Kylix compiler for Linux under an emulated Linux environment.

如果你想要一个 Borland Delphi 交叉编译器,你唯一的选择是CrossKylix. 这不是真正的交叉编译器。相反,您在模拟的 Linux 环境下运行适用于 Linux 的 Kylix 编译器。

Note that you'll be forced to use CLX rather than VCL and that Kylix is well and truly dead nowadays. Personally I think Wine is probably an easier and better option.

请注意,您将被迫使用 CLX 而不是 VCL,并且 Kylix 现在已经完全消失了。我个人认为 Wine 可能是一个更简单更好的选择。

回答by mega.venik

First of all, it all depends on what system functions you used in your programm. In most cases, there will be no possibility to cross-compile it under linux.

首先,这完全取决于您在程序中使用的系统功能。大多数情况下,在linux下是不可能交叉编译的。

But, in some cases Borland Kylix can help, but, afaik, it's almost dead now.

但是,在某些情况下,Borland Kylix 可以提供帮助,但是,afaik,它现在几乎死了。

回答by doctorlai

Delphi 10.2 Tokyo supports Linux 64-bit Native Code Compilations.

Delphi 10.2 Tokyo 支持 Linux 64 位本机代码编译。

To get some preview screenshots, click this post:

要获取一些预览屏幕截图,请单击此帖子:

https://helloacm.com/delphi-compiles-code-to-linux-64-bit-server/

https://helloacm.com/delphi-compiles-code-to-linux-64-bit-server/

enter image description here

在此处输入图片说明