Cocotron
April 2, 2008

In order to ease the port of a Mac OS X Cocoa software to Windows, I'm evaluating Cocotron, an opensource project basically reimplementing the Cocoa Objective-C API for Windows.

The project is quite advanced and it's very surprising how much work has been done. Some simple examples such as TextEditor.app are effectively portable.

The development is very comfortable because you can develop on the Mac and cross-compile in XCode.

A XCode Cocotron project has two targets, a Mac one linking with Apple frameworks, and a Windows one that links with Cocotron frameworks, generates a Windows exectuable and embedded the frameworks as dlls in the application bundle.

Some strange behaviours occur on the Windows runtime, but fortunately you can set up a debugger on Windows.

Here is what porting and debugging Sketch looks like:

Cocotron web site: http://www.cocotron.org/

Cocotron source code: http://code.google.com/p/cocotron/source/browse

Christopher Lloyd blog: http://www.objc.net/blogger/