macos Mac 上的 Delphi - 可能吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/504152/
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-10-21 06:01:48  来源:igfitidea点击:

Delphi on the Mac - possible?

iosdelphimacos

提问by Ryan

I am responsible for a Delphi/Win32 project management application. I have just completed a move to Delphi 2009.

我负责 Delphi/Win32 项目管理应用程序。我刚刚完成了到 Delphi 2009 的迁移。

More and more US based users want to use the application on their Mac computers, while the majority are Windows users.

越来越多的美国用户希望在他们的 Mac 计算机上使用该应用程序,而大多数是 Windows 用户。

Are there solutions out there to easily build a Delphi app that will natively run on MacOS?

是否有解决方案可以轻松构建可在 MacOS 上本地运行的 Delphi 应用程序?

Update:

更新

With the release of RAD Studio XE2 in late 2011, Delphi developers should be able to build once and distribute on Win 32/64 and MacOS 32, with iOS support promised.

随着 2011 年底 RAD Studio XE2 的发布,Delphi 开发人员应该能够在 Win 32/64 和 MacOS 32 上构建一次并分发,并承诺支持 iOS。

采纳答案by Rob Kennedy

Mac OS X doesn't run Windows programs. It doesn't provide anyof the API you'd need, such as the functions in kernel32, user32, etc.

Mac OS X 不运行 Windows 程序。它不提供您需要的任何API,例如 kernel32、user32 等中的函数。

You could try running your program via Crossover. Other options include virtual machines, such as VMware Fusionand Parallels.

您可以尝试通过Crossover运行您的程序。其他选项包括虚拟机,例如VMware FusionParallels

Another thing you might try is to use .Net. Convert your program to use the .Net version of Delphiand then run it on Mono on the Mac. I wouldn't put a lot of confidence in this method, though.

您可能会尝试的另一件事是使用 .Net。将您的程序转换为使用Delphi 的 .Net 版本,然后在 Mac上的Mono 上运行它。不过,我不会对这种方法充满信心。

回答by SeanX

Your options to run native Delphi code on OSX are pretty limited. You can use Lazarus/Freepascal but that is a long way behind Delphi. It will produce native code.

在 OSX 上运行原生 Delphi 代码的选项非常有限。您可以使用 Lazarus/Freepascal,但这远远落后于 Delphi。它将生成本机代码。

Alternately you can use Prism and Mono. That apparently works well. Have a look at http://devcenter.remobjects.com/osxor http://wiki.remobjects.com/. Also, check out the remobjects blogs, and the embarcadero.public.delphiprism.mono.osx newsgroup.

或者,您可以使用 Prism 和 Mono。这显然运作良好。看看http://devcenter.remobjects.com/osxhttp://wiki.remobjects.com/。另外,请查看 remobjects 博客和 embarcadero.public.delphiprism.mono.osx 新闻组。

That needs the mono redistributable. However mono also supports linking and ahead of time compilation so you might be able to get something close to native code on it.

这需要单声道可再发行。然而,mono 还支持链接和提前编译,因此您可能能够在其上获得接近本机代码的内容。

In either case, you will need to rewrite your ui as the osx look and feel and conventions are different.

在任何一种情况下,您都需要重写您的 ui,因为 osx 的外观和感觉和约定是不同的。

回答by Reallyethical

This is a very old thread but for people browsing here and looking for an answer in Q3 of 2011 or later the answer is yes.

这是一个非常古老的线程,但对于浏览此处并在 2011 年第三季度或之后寻找答案的人来说,答案是肯定的。

With the release of Rad Studio XE2 this year, Delphi Developers will be able to create native applications for Mac OS as well as Win32, Win64 and iOS more platforms coming soon.

随着今年 Rad Studio XE2 的发布,Delphi 开发人员将能够为 Mac OS 以及即将推出的 Win32、Win64 和 iOS 更多平台创建本机应用程序。

回答by Reallyethical

While the Lazarus route is not a no brainer recompile, I've good experiences with it. I tried the (Delphi).NET+mono way before (to WinCE, Linux and OS X), and failed miserably.

虽然 Lazarus 路线不是一个简单的重新编译,但我对它有很好的经验。我之前尝试过 (Delphi).NET+mono 方式(到 WinCE、Linux 和 OS X),但失败了。

Codegear talks a lot, but the next Delphi version will only have a PREVIEW of 64-bit (cmdline compiler). If you assume the version after that is the full 64-bit product, you can be sure that OS X is at the earliest 2 years away.

Codegear 讲了很多,但下一个 Delphi 版本将只有 64 位(cmdline 编译器)的预览版。如果您假设之后的版本是完整的 64 位产品,您可以确定 OS X 最早也要 2 年。

Lazarus or recoding.

拉撒路或重新编码。

回答by lkessler

There may be some hope for the future for Delphi and the Mac.

Delphi 和 Mac 的未来可能有一些希望。

The Podcast at Delphi.Orgreviewed the closing keynote at CodeRage III (Dec 2008) when Embarcadero's Wayne Williams talked about the Future. It said this:

Delphi.Org 的播客回顾了 CodeRage III(2008 年 12 月)的闭幕主题演讲,当时 Embarcadero 的 Wayne Williams 谈到了未来。它是这样说的:

I think the most exciting part of Wayne's talk was the slide marked “The Future” which listed some of the company wide research initiatives underway. It specifically listed Mac, Linux, Cloud, Application Virtualization, FireBird, Touch, 64bit, SMP and Multi-core. When I asked about a Delphi for Mac and Linux they said that today, with Delphi Prism and Mono you could reach Mac and Linux, but in their labs they were working on native support, and that they had a significant head start.

我认为韦恩演讲中最激动人心的部分是标有“未来”的幻灯片,其中列出了公司范围内正在进行的一些研究计划。它特别列出了 Mac、Linux、云、应用程序虚拟化、FireBird、Touch、64 位、SMP 和多核。当我问及适用于 Mac 和 Linux 的 Delphi 时,他们说今天,使用 Delphi Prism 和 Mono,您可以访问 Mac 和 Linux,但在他们的实验室中,他们正在研究本机支持,并且他们领先一步。

回答by Peter Turner

I listened in on one of the recent Delphi 2009 show-off conference calls and they said that it was possible to run on a Mac using Delphi Prism and there is an automatic conversion utility called Oxidizer. I'm not sure if you'd call that native since you'd need Mono, but I think it's better than Wine.

我听了最近一次 Delphi 2009 炫耀电话会议,他们说可以使用 Delphi Prism 在 Mac 上运行,并且有一个名为 Oxidizer 的自动转换实用程序。我不确定您是否会称其为本地人,因为您需要 Mono,但我认为它比 Wine 更好。

回答by skamradt

Another alternative would be to develop a web based application. This avoids the "gui is different" problem and allows you to focus on your product. If you look at some of the latest AJAX controls, you can get pretty close to a full desktop application experience without having to sacrifice much. If your application needs to run locally, then developing a local web service in Delphi and translating it to Lazarus specifically targeting OSX seems to me to be a much easier and manageable task.

另一种选择是开发基于 Web 的应用程序。这避免了“gui 是不同的”问题,并使您可以专注于您的产品。如果您查看一些最新的 AJAX 控件,您可以非常接近完整的桌面应用程序体验,而无需牺牲太多。如果您的应用程序需要在本地运行,那么在 Delphi 中开发本地 Web 服务并将其转换为专门针对 OSX 的 Lazarus 在我看来是一项更容易和易于管理的任务。

回答by skamradt

We have released a new product for creating cross platform apps (Mac OSX) using Delphi/Free Pascal. have a look at http://twinforms.com/

我们发布了一个使用 Delphi/Free Pascal 创建跨平台应用程序 (Mac OSX) 的新产品。看看http://twinforms.com/

回答by Paul Lefebvre

There's not really a good solution for this. Someone mentioned Lazurus, but it's not "there" yet. Delphi is just not a cross-platform tool. If you really want a Mac version then you probably ought to look at alternatives.

对此没有很好的解决方案。有人提到了 Lazurus,但它还没有“存在”。Delphi 只是不是一个跨平台的工具。如果您真的想要 Mac 版本,那么您可能应该寻找替代品。

If your app is consumer-based, your users will expect lots of Cocoa goodness. Using anything else to make a Mac app will make them cranky.

如果您的应用是基于消费者的,那么您的用户将会期待 Cocoa 的许多优点。使用其他任何东西来制作 Mac 应用程序会让他们变得暴躁。

However if it's more of a business app, then that's usually less important. I use REALbasic to build lots of Mac/Windows business applications. It's very similar to Delphi so it should be easy to pick up.

但是,如果它更像是一个商业应用程序,那么这通常就不那么重要了。我使用 REALbasic 构建了许多 Mac/Windows 商业应用程序。它与 Delphi 非常相似,因此应该很容易上手。