views:

2227

answers:

15

Who uses Macs for cross-platform development?

By cross platform I essentially mean you can compile to target Windows or Unix (not necessarily both at the same time). I understand that this also has a lot to do with writing portable code, but I am more interested in people's experience with Mac OS X to develop software.

I understand that there are a range of IDEs to choose from, I would probably use Eclipse (I like the GCC toolchain) however Xcode seems to be quite popular. Could it be used as described above? At a pinch I could always virtualise with VirtualBox or VMware Player or parallels to use Visual Studio (or dual boot for that matter). Having said that I am open to any other suggested compilers (with preferably an IDE that uses GCC.)

Also with the range of Macs available, which one would you recommend? I would prefer a laptop (as I already have a desktop) but am unsure of reasonable specifications.

If you are currently using a Mac to do development, I would love to hear what you develop on your Mac and what you like and don't like about it.

I would primarily be developing in C/C++/Java. I am also looking to experiment with Boost and Qt, so I'm interested in hearing about any (potential) compatibility issues.

If you have any other tips I'd love you hear what you have to say.

+8  A: 

Well, using a Mac is just about (discounting OSX86) the only method of actually being able to test on Mac + Windows + Linux all on the same hardware. That being said, I wouldn't go that route if that was your only reason. If you're more comfortable programming in a Windows environment, I would say to do your work in windows, and have a Mac Mini on the side, possibly even a used one you pick up for cheap just to test your software.

Kibbee
Hell, do it in Windows *on the Mac* and save money on having multiple machines.
eyelidlessness
Except that the requirements of a machine that could run windows and mac well enough for development would be much more expensive than just buying a mac mini and a windows machine.
Kibbee
But it sure is convenient to have everything you need on one piece of hardware. A MacBook Pro is a great cross-platform development machine that you can use anywhere.
Paul Lefebvre
+1  A: 

Depends on what you want to develop. If it's GUI apps you might want to develop and test on the target platform. For Java related development (especially enterprise) it's great to work on a mac, especially since Apple released jdk1.6 not long ago. Eclipse and Netbeans are the IDEs I'm using on both Mac and Linux.

Fabian Buch
A: 

I've used Qt over the years to do cross-platform development (and just because I like it). I'd encourage you to look at it. It event model (SIGNAL/SLOT) is different but isn't bad at all once you start using it.

itsmatt
+1  A: 

I use my Macs for cross-platform-programming. However, my projects are fairly small and seldomly contain GUIs.

I have set up virtual machines to do the compilation. As for IDEs my experience shows that it is often required to have "native" project files to share with other developers. Hence, I primarily develop in XCode and in the end create one project in Visual Studio and a Makefile for Linux. If possible however, I set all the projects up so that they share the source files.

Eclipse projects are fairly compatible for Linux and OSX, but not Windows.

As others already proposed, I would recommend to use the IDE and OS you are most comfortable with and then port it to the other platforms.

Depending on the size of your projects I would recommend an iMac or MacBook Pro for cross-platform development. Also, Virtual Machines can be quite demanding, so be sure to get enough ram.

BastiBechtold
+3  A: 

Eclipse runs on Mac and is well supported. For example, it's the recommended environment for developing for Android on Mac (and all other platforms).

XCode is targetted at OS X native development, you may be able to wrangle it in to cross-compilation for Windows but you'd be very much going against the grain.

I do a little development in XCode but mostly I'm a .NET developer, for which I use VMWare on my Mac. That may sound a bit backwards, but a Windows XP box running on VMWare on the an iMac absolutely flies (I have 4Gb of RAM) and I can create and modify virtual machines for testing (e.g.: Vista, weird Windows XP setups) very quickly. On top of all that, using a Mac day-to-day feels like bliss compared to Windows (I'd never used a Mac until about 15 months ago, I'll never go back to a permanent Windows desktop).

Stewart Johnson
+2  A: 

I'd certainly give Mono a look-in. It has cross-platform bindings for Qt and GTK. You also have access to MonoDevelop which is improving in leaps and bounds.

If that's of no interest to you, one thing I will mention is that VMWare and Eclipse work well together. VMWare Workstation Professional comes with an Eclipse plugin to allow remote debugging and do multiple-os deployment testing with a couple of clicks. I'd certainly recommend you get the free trial and see if that works for you.

And a Mac is a great platform to start on. Most things that aren't ported from Linux to run natively run fine on top of X11.

Oli
+2  A: 

Simply to answer the recommendation question: The new Macbook (low end model) should make an excellent development machine, if you do need a portable. And anecdotally, I used to have a Mac mini, simply because it's what I could afford, and it was excellent for most purposes. I even carried it between home and office (kept another monitor/keyboard/mouse at office, but i do even now that I have a MBP) and it was awesome. I didn't even notice it was in my backpack.

Edit: and there's nothing stopping you from double- or triple-booting your Mac, and doing all of your dev in Windows/*nix/OS X on the Mac.

eyelidlessness
+2  A: 

If you're looking for a single build system, a Mac is probably your best choice, as you can cross-compile to Windows and Linux using GCC.

There are compilers that target Darwin/OSX from Linux, but you won't get any of the Cocoa or Foundation libs with that approach. At least with MinGW, you have access to a big part of the Windows platform SDK.

seisyll
+1. I haven't tried MingGW from Mac, but it works great from Linux. I've been able to do C/Gtk+ programs with this approach. The only Win32 specific program was the packager (which I used wine to run).
eduffy
A: 

Hello,

Here you will find an interesting post about LinkedIn being developed 100% on mac...

pgras
+2  A: 

I have switched to a mac as my main development machine a year ago and never looked back.

The one thing I like to mention is, that you write often better software if you develop on more than one platform. From time to time I've found out, that some pieces of code do work on a specific platform and fail on another. Mostly this was due some errors of me instead of software bugs.

So in my book - cross platform development enforces more correctness.

razong
+2  A: 

I use an old Mac Mini at home for Windows development inside a virtual machine. I have had a really good experience with it. If I go full-screen, then it feels just like a desktop - the performance is surprisingly good.

You may find these posts interesting:

Minimum hardware for effective mac development

Mac virtualization: VMWare Fusion or Parallels?

Using 3-D in Virtual Machines

JosephStyons
+2  A: 

Another option is Cocotron. It runs on Mac OS X, and includes cross-compilers that target Windows, Linux, and Solaris, an Objective-C runtime and portable Foundation framework that works with all three, and an AppKit framework for Windows.

Sherm Pendley
A: 

I use a MacBook for cross platform development, but I do not cross compile for other targets. It just isn't worth the hassle given how cheap it is to run multiple platforms these days. You can either use a virtualization product like VMware or just have a secondary box to multi-boot for Windows and Linux. You absolutely must have a fully automated build on every platform. Joel is always right. ;)

Alienating customers with a foreign UI is a big risk, so I recommend building a common backend and platform-specific frontends. I don't have any experience with Qt, but I have used Tk for cross platform C++ applications. It would not have worked except that I had a captive corporate audience happy just to have the software on multiple platforms at low cost.

Ken Fox
A: 

I've written a small cross-platform UML editor in C++, for my MSc thesis degree, and I've written most of the code in my Mac in Xcode:

http://remproject.org/

For managing builds in Windows and Linux I used CMake, which generated the Xcode, Visual Studio and Makefile projects in each platform.

http://cmake.org/

I've also used two libraries in it, Juce and POCO, the former for the GUI, the latter for specific functionality. All statically linked in each platform.

In my opinion you can write cross-platform code in many ways, this is one of them and I'm happy with it, I could do this quite quickly, and I got my degree :)

Adrian Kosmaczewski
+3  A: 

I do all my cross-platform development on a MacBook Pro, primarily using REALbasic. For testing on Windows and Linux, I use VMware Fusion which works well with the remote debugger included with REALbasic.

I used to have Boot Camp set up with Windows when I was doing .NET-related development. VMware and Parallels are quite fast, but are no match for natively booting the OS. I haven't had a chance to extensively try MonoDevelop in Mac OS X, but apart from lacking a GUI designer it looks like it might work well and I'll probably look into that for any future .NET projects I may do.

I prefer to have just the one computer that can run all the OSes because it is less space on my desk, less hardware to upgrade and manage and much easier to take all OSes with me.

Any Mac these days can handle running Windows and Linux well enough. The most important thing you need is lots of RAM. Macs nowadays can handle at least 8 GB and I'd recommend that as a starting point (I have 6 GB).

Paul Lefebvre