Qt jumps to LGPL for future versions. This can bring a lot of new chances for projects like Naro to use different platforms.
This weekend I had tried to make on Linux using Mono an OpenCascade project. As they were some samples using Qt 4 I wanted do see how hard is to make all runs on top of Mono. So the rules are simple: make mono to run first and create a QT application that in it's own start an OpenCascade sample.
The good news is that I had used Ubuntu 9.04 which brings OpenCascade (6.2, not 6.3 which is the latest stable) libraries in the default repository! The same about Qt and Mono development (excluding that MonoDevelop IDE package is broken but will be fixed till the final release). So it can make NaroCad to be a very Ubuntu developer friendly project.
I took a Qt4/OCC working project and I had move all code in a QMake/QT library project. The changes are pretty minimalist (mostly is to move sources around and change the template of project from app to lib). Second step was to export to a C interface and I chose to export the main method using another function namely: startMain like this:
int startMain(int argc, char** argv);
#endif // QTGUIBACKEND_H
and in cpp file:
int main(int argc, char** argv);
int startMain(int argc, char** argv)
printf("hello world from lib\n");
return main(argc, argv);
After test that all compiles I did the mono work that uses P/Invoke as is explained here.
So I created a class named Starter and the code is:
public class Starter
private static extern int startMain (int argc, string argv);
public static void Main(string argv)
The path is hardcoded but can be changed easily using a .config file but I did decide to try the minimalist path lately and viola, here is the result you see.