在Mac上编译C ++程序以在Linux上运行 [英] Compile C++ program on Mac to run on Linux
问题描述
我有一个应用程序,我在C ++ / SDL中使用FMOD库。该应用程序是便携式和编译,没有任何代码更改在Mac和Linux上。但一个烦恼是,当我要运送Linux版本,我必须运行我的Linux盒子,复制源代码在那里(通过USB驱动器,因为我没有网络,它是一台旧的笔记本电脑),并编译,然后复制它再次通过USB到我的Mac并上传。
I have an application that I wrote in C++/SDL, using FMOD library. The app is portable and compiles without any code change on Mac and on Linux. But one annoyance is that when I want to ship Linux version, I have to run my Linux box, copy the source code over there (over USB drive, because I have no network there, it's an old laptop) and compile it, then copy it again over USB to my Mac and upload it.
我的问题是 - 有更好的方法吗?理想情况下,我是否可以编译应用程序直接从Xcode在Linux上运行,我在哪里为Mac编译?
My question is - is there a better way of doing it? Ideally, could I compile the app to run on Linux directly from Xcode, where I compile it for Mac?
推荐答案
用于OSX上的Linux的交叉编译显示此页面。
A quick google for cross-compiling for Linux on OSX revealed this page.
其实,在如何从Mac OS X到Linux x86交叉编译?。
这篇关于在Mac上编译C ++程序以在Linux上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!