You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, September 21st 2011, 10:55am

Problem loading a QT plugin

Hi i'm trying to use the Plugin but I have some problems:

I have a Camera interface: I_GeneralCamera.h. I would like to choose the implementation of the camera by creating a plugin which I could change by

Source code

1
QPluginLoader lib(libraryName);


I created a plugin and works. The problem started creating a second plugin with an implementation that uses a Camera library provided by the camera company.

If I create the plugin just printing some text like

Source code

1
cout << "The function XXX started" << endl


it works fine. If I'm using any function of the camera library it compiles find but when i try to load the plugin by

Source code

1
2
3
4
5
6
7
8
QPluginLoader lib(libraryName);
if (QObject *plugin = lib.instance()){
cout << "OK!" <<endl;
}
else
{
cout << "KO" <<endl;
}


I get always the KO! Any idea where the error could come from? I have no error in compilation but it seems that this library is changing someway the library structure and it is not recognized as plugin of I_GeneralCamera.

Thanks in advance!