Cross-Platform Objective-C / C++ Development Cross-Platform Objective-C / C++ Development windows windows

Cross-Platform Objective-C / C++ Development


I work for a software company that produces software for Mac OS X and Windows using C++, MFC, and Objective-C.

Yes, it is definitely possible.

You probably will be best served if you develop the "core" of the application in C++. In a MVC application, the C++ part would be the model, and possibly the controllers. For the code that interfaces to the GUI and other OS-specific interfaces, you should use the native APIs: Objective-C on Mac OS X and C# on Windows XP.

The good thing about the Mac is that you can compile C++ and Objective-C together. You can even have Objective-C++ where C++ and Objective-C are compiled in the same compilation unit. Unfortunately you cannot do this with C# (there is something called Managed C++ which is a different beast).

I would avoid cross-platform frameworks such as Qt and wxWidgets. They both allow you to develop cross-platform applications, but the look and feel of such applications is sub-par. I have more familiarity with wxWidgets though, its design is heavily geared towards the Windows MFC paradigm of application design.

Edit May 14, 2009, 9:44 AM EST: If Qt now allows true look and feel of the native platform, it could be a good option. I haven't looked at the latest offering so you may want to look at that framework before designing your own. That decision should be made after examining the results of the applications and how comfortable you are with the design paradigms that Qt requires.


You could look at Qt. I've used it successfully on Windows, Linux and Mac OSX projects.


what I use, is have a common library written in C or C++ with all the core functionality of your application.

Let's say you are building a solitaire game. So you will have core classes in a pure C++ (mostly platform independent) library.

  • CoreSolitaire

Then, you will have separate UI projects, one for each platform you want to deploy your solitaire on:

  • iSolitaire (Objective-C, MultiTouch Cocoa Based for iPhoneOS)
  • MacSolitaire (Objective-C, Cocoa Based for Mac OS X)
  • WinSolitaire (C++, Win32 or C# Based for Windows plaforms)
  • GSolitaire (C++, GNome/GTK based for linux/unix)

It's more work, but, in my opinion, the resulting product is definitely better than one you could get by using a platform independent widget set like QT or wxWidgets.

Having said this, if you are going to deploy your product internally in a company where you have full control of the deployment environment, and you don't care that much about how the resulting product will behave on different platforms, you could definitely use a common API for everything (QT, wxWidgets, or any other you might encounter).