I have an existing Qt application that compiles on both Mac and PC with Qt Creator. With the help of the Qt plugin for Visual Studio 2008, I have created a VS 2008 project for the application. The intention was ultimately to create a shared library, and I was able to change the VS 2008 project from creating an application to a shared library by simply changing the project type to produce a dll file instead of an exe (via the project properties).
As usual with Qt applications, the "main" entry point simply creates a QApplication, shows the main window (widget) and execs it:
int main(int argc, char *argv)
QApplication a(argc, argv);
In VS 2008, I was able to turn this into a DLL by simply changing the project type to dll from exe, and changing the suffix accordingly. By adding code for a function that's known by another program, that other program can load the dll, and execute the function. That entry point simply does just what main() does, and so the host program launches the app as a "plugin".
So far, so good, eh?
Well, now I'd like to do the same thing on a Macintosh. Of course, the same source compiles under Qt Creator on the Mac. But although I've done some XCode and Qt Creator application programming on the Mac, I just don't know where to begin. I don't really care if I use XCode or Qt Creator for development, but I basically just need a project that creates a shared library (a dylib) from the source code for the application, and add the few entry points that the host program can call, and again simply launch QApplication, show the main window (dialog), and exec.
Should be pretty simple, but documentation is sparse, and web searching just leads down a lot of rat-holes...
Any help/advice/example projects (either XCode or Creator) would be most welcome!
[EDIT: code formatting, please wrap in @-tags, Volker]