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

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



> What /exactly/ are you trying to convert into a lib? The /whole/
> application? I would be surprised if that worked! Usually an 
> application as a main() entry function, and if you tried to link 
> that with another application

Ok, the whole application except that I renamed the main function. I was aware of that problem. 

> (that's the point of having a lib, right? :) then I would expect 
> "duplicate symbol" linker errors.

No, everything compiles and links fine. I just get a segfault when the lib is loaded. Regardless how I try to load it, e.g. dlopen("myLib",RTLD_LAZY) segfaults at once. 

Why I am trying to do something strange like that? My customer has some sort of "main program" which he wants extended. He has a couple of tcl/tk progams, which he wants translated into C++/Qt and integrated as dynlibs into his main program. But please not as Qt plugins. The main program must remain Qt free. So my idea was to write a normal Qt program, rename the main function to something like 'start' and provide some sort of interface, so that the main program can control it. Practically it is like recreating the plugin functionality without Qt. I don't like it, but customer is king. :-(



  
-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser



More information about the Qt-interest-old mailing list