[Solved] Plugin depending on a shared lib problem
I am trying to implement a Qt plugin built around a framework, in a shared library. Basically, the framework defines abstract types and mechanisms for Nodes creation, linkage and communication between those nodes. Different Qt plugins would be created to implement concrete node definitions and be used as a factory to provide these nodes to the client application.
I am having some problems loading the plugin in the client application. I get the famous "Cannot load library /workspace/projects/shootbox_plugin/trunk/plugins/libsb-ipmdl.so: (/workspace/projects/shootbox_plugin/trunk/plugins/libsb-ipmdl.so: undefined symbol: _ZTI9NodeDatum)" and have no idea what to do. The undefined symbol, NodeDatum, is an abstract class from the framework lib.
Would you have any idea about what would cause this or I did that I shouldn't have done?
By the way, yes, my plugin interface is all pure virtual.
Check that the library containing that symbol can be found when you start your application. i.e use ldd on your plugin to see if it can find all dependencies
Thank you for your answer and sorry for the late reply. An accident made me lose 2 weeks of work on this and I had to start over again...
I just got to this point where I was stuck and, unfortunately, the dependencies seem to be resolved correctly. That does not seem to be the problem.
EDIT: Found some issues with some abstract type definitions (still a bit new to C++...). I am now stuck with an "Unknown error" which I have no clue how to debug.
I managed to make it work although I still get the "Unknown error" message.
I am not familiar at all with the Qt source code, but digging into the source code of the QPluginLoader class, I found this:
@QString QPluginLoader::errorString() const
return (!d || d->errorString.isEmpty()) ? tr("Unknown error") : d->errorString;
Do I understand correctly that if the errorString is empty, "Unknown error" is thrown to the user instead of "No error" or something like that?!
Indeed, but it's not necessarily wrong.
I.E. If load returns true, you don't have to check the error string. But if it return false and the error string is empty, then it's an unknown error.
Right. Well, thank you, I consider this solved!