問題描述
我想將我的 C/C++ 應用程序移植到 OS X.
I would like to port my C/C++ apps to OS X.
我沒有 Mac,但我有 Linux 和 Windows.有沒有這方面的工具?
I don't have a Mac, but I have Linux and Windows. Is there any tool for this?
推薦答案
似乎有一些腳本 幫助您為 Mac 設置交叉編譯;我不能說它們有多好,或者如何適用于您的項目.在文檔中,他們參考了這些說明以進行 10.4 的交叉編譯,以及 這些 用于 10.5 的交叉編譯;這些說明可能比腳本更有幫助,具體取決于腳本對您的需求的滿足程度.
There appears to be some scripts that have been written to help get you set up cross compiling for the Mac; I can't say how good they are, or how applicable to your project. In the documentation, they refer to these instructions for cross-compiling for 10.4, and these ones for cross compiling for 10.5; those instructions may be more helpful than the script, depending on how well the script fits your needs.
如果您的程序是免費或開源軟件,那么您可能希望創建一個 MacPorts 端口文件(文檔此處),并允許您的用戶使用 MacPorts 構建您的程序;這通常是在 Mac OS X 上安裝可移植的免費或開源軟件的首選方式.過去已知 MacPorts 可以在 Linux 上運行,因此有可能在 Linux 上開發和測試您的 Portfile(盡管它顯然需要將在 Mac 上進行測試).
If your program is free or open source software, then you may wish instead to create a MacPorts portfile (documentation here), and allow your users to build your program using MacPorts; that is generally the preferred way to install portable free or open source software on Mac OS X. MacPorts has been known to run on Linux in the past, so it may be possible to develop and test your Portfile on Linux (though it will obviously need to be tested on a Mac).
這篇關于如何在 Linux 或 Windows 中為 OS X 編譯?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!