Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile C++ program on Mac to run on Linux [duplicate]

Possible Duplicate:
How to cross compile from Mac OS X to Linux x86?

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.

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?

like image 481
mav Avatar asked Jun 17 '10 09:06

mav


2 Answers

A quick google for cross-compiling for Linux on OSX revealed this page.

Actually, this has been asked before in How to cross compile from Mac OS X to Linux x86?.

like image 165
2 revs Avatar answered Sep 20 '22 09:09

2 revs


Take a look at How to cross compile from Mac OS X to Linux x86? and the links therein (it suggests compiling under Linux running in a VM, probably the best idea, since trying to setup cross-compiling usually isn't worth the work and trouble).

like image 42
Greg S Avatar answered Sep 21 '22 09:09

Greg S