[Qt-interest] Making a Qt program into a dynamic library

Guido Seifert Wargand at gmx.de
Tue Dec 15 17:43:43 CET 2009



> Okay, so I understand you are trying to have an 
> "application within an application" of some sort, with its own event 
> queue etc., so your "start"
> function (former main()) would e.g. look like this:
> 
> int start(int argc, char **argv) {
>   QApplication app(argc, argv);
>   ...
>   // create your application window/dialogs, show them etc.
>   ...
>   return app.exec();
>  }

Yep.

> I guess QApplication probably does not like that there is "something
> around it" (the application which dynamically links to the library 
> and calls start()), so initialisation of the Qt event queue, 
> resources etc. fails (maybe).

Actually no. The program crashes even if the start funtions looks like 
this:

int start(int argc, char *argv[]){
  return 1;
}

It is enough to have a CONFIG += qt in my .pro file to trigger the crash. It must happen while the lib is being loaded. Long before it even comes close to my code.

> ... does that work with your approach? 

Probably not. And it would not help. 
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the Qt-interest-old mailing list