英文:
How to target Linux Platform on Delphi?
问题
我想使用Delphi为Linux开发应用程序,但Linux不是我的目标平台选项:

开始使用Delphi开发和编译Linux应用程序的步骤是什么?
我需要什么?
英文:
I want to develop an app for Linux using Delphi, but Linux isn't a target platform option on my side:
What are the steps to start developing and compiling apps for Linux using Delphi?
What do I need?
答案1
得分: 4
以下是使用Delphi开发Linux应用程序的完整指南:
设置WSL2(Linux环境):
- 从Microsoft Store下载
Ubuntu: - 安装完Ubuntu后,点击“打开”按钮并设置您的帐户。
- 使用以下命令确保您的Ubuntu WSL完全更新:
sudo apt-get update -y && sudo apt-get upgrade -y
- 使用以下命令设置Delphi PAServer:
curl -L https://embt.co/SetupUbuntu4Delphi22 | bash
- 使用以下命令启动运行Delphi PAServer:
~/pa22.sh
设置Delphi IDE:
- 您需要安装
Delphi 10.4或更新版本,也需要是IDE的企业版。 - 此外,您需要确保在IDE中安装了Linux平台。
- 您需要从“GetIt Package Manager”安装
FMXLinux。 - 转到“工具 > 选项 > 部署 > 连接配置文件管理器”并设置与Ubuntu WSL中的PAServer的连接。
- 转到“工具 > 选项 > 部署 > SDK管理器”并添加一个新的Linux SDK。
- 现在,您可以创建一个新的多设备应用程序(FireMonkey/FMX),并应该看到Linux作为一个选项。
- 如果您没有看到Linux选项,只需右键单击并选择“添加平台”。
这就是全部内容。现在,您应该能够使用Delphi编译和构建Linux应用程序。
英文:
Here's a full guide for developing apps for Linux using Delphi:
Setting up WSL2 (Linux Environment):
- Download
Ubuntufrom theMicrosoft Store:

- Once Ubuntu is installed, you can click on the
Openbutton and set up your account:

- Make sure your Ubuntu WSL is fully up to date using the following command:

sudo apt-get update -y && sudo apt-get upgrade -y
curl -L https://embt.co/SetupUbuntu4Delphi22 | bash
~/pa22.sh
Setting up the Delphi IDE:
- You need
Delphi 10.4or newer installed. This also needs to be theEnterprise Editionof the IDE. - Additionally, you need to make sure you have the Linux Platform installed in your IDE:

- You need to install
FMXLinuxfrom theGetIt Package Manager:

- Go to
Tools > Options > Deployment > Connection Profile Managerand set up a connection to your PAServer in the Ubuntu WSL:


- Go to
Tools > Options > Deployment > SDK Managerand add a new Linux SDK:


- Now you can then create a new Multi-Device Application (FireMonkey/FMX) and you should see Linux as an option:


- If you don't see Linux, then you simply need to add it by right-clicking and selecting "Add Platform":


And that's it. Now you should be able to compile and build applications for Linux using Delphi.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。




评论