Christian Beer

Christian Beer

Cross Compile ProVoc With Cocotron?

To build a vocabulary editor for Windows I considered building one in Java as the only option. But then I found the project Cocotron. Cocotron is an implementation of Cocoa for Windows and Linux (and could also be ported to other plattforms). It is easily integrated to Xcode so that you can build the Windows version of your application with few clicks.

For building Cocotron you need to install some tools. These are downloaded and installed with few steps that are well documented on the Cocotron website. The navigation is not always clear on that website but you can find your way through it. The website itself is also coded in Objective-C and compiled for Linux using Cocotron.

After you installed the needed tools you can checkout (or download) and compile Cocotron. For me the Cocoa project was all I had to build since it references some of the other needed packages. With the build process the library gets installed into the Developer folder.

The next step is to add a new target to your existing (or new) project. You can easily do so by copying an existing Mac OS target and clean up and adapt the build settings. That process is also well documented on the Cocotron website but it take some trial and error for me to find out if I did all I need. As soon as you don’t get any low level errors from gcc you can start porting your application. Depending on the complexity of your application it may use some parts of Cocoa that are not implemented in Cocotron by now.

For ProVoc the last part was not easy and is not finished by now. I added many #ifdef _WIN32 and #ifndef __APPLE__ to the code to disable unimplemented parts and it builds without errors (but with many warnings). ProVoc starts on Windows but there still seem to be some problems as it hangs shortly after starting. You can also debug your application on Windows using Insight-GDB what I started to do at last.

As soon as I find some free time I will continue trying to get ProVoc run on Windows and I will post my findings here.