View Full Version : Changing using the library LTDL with static library created with Qt

19th December 2012, 18:34
Hello to all. I have a project in which you use a library created using LTDL. This code has the following:

lt_dlhandle handle = NULL;

char libname[256];
sscanf( lib, "%s %*s", libname );

if(( handle = lt_dlopenext( libname ) ))
model_callback_t initfunc = (model_callback_t)lt_dlsym( handle, "Init" );

// pass complete string into initfunc
AddCallback( ..., initfunc, ...);

where lib is the name of the library created using LTDL. I want to change a piece of code which I quoted above, with a piece of code where the same library was created using Qt.
I would therefore will replace the code
handle = lt_dlopenext (libname) and

lt_dlsym( handle, "Init" ) . The Init is the name of a library function created using LTDL.
Can you help me ?

19th December 2012, 20:20
Not without knowing what lt_dlopenext and lt_dlsym do. Did you not think that might be kind of important?

20th December 2012, 09:18
lt_dlopenext and lt_dlsym are 2 functions LTDL which serve respectively to obtain handle to the library LTDL and the function Init (one library made ​​using LTDL). Mode instead of using Qt to create and use your own static library, I do not know where to start to do the same thing LTDL. This transformation is necessary because I want to make a port of the entire project using Qt. This project is Player-Stage that I mentioned in another post in which I asked about FLTK. I would be able to compile Qt, but there is this part

20th December 2012, 12:48
Do you just want to use the library in Qt? If yes, then just use it!

If you want to re-write everything, then maybe look at Qpluginloader