[Qt-interest] moc hates my shared objects?

Andreas Pakulat apaku at gmx.de
Sun Mar 1 02:58:05 CET 2009


On 28.02.09 23:41:49, Andrea Franceschini wrote:
> It seems that I am given to understand that the same functionality can
> be achieved through the QPluginLoader, right?
> 
> Anyway, if anybody can explain the behaviour I described, it would be
> an additional piece of knowledge for me :)

The reason is that the linker needs to resolve all symbols a shared object
references when loading that shared object. It uses the list of other
shared objects (or libs) your plugin links against to try to resolve them.
But none of those libs has that symbol defined. This is the behaviour
defined for the linker, hence you're getting the error.

The usual way to create plugins is to have a shared library that contains
all the needed interfaces/classes that plugins should use and then link the
plugins against that library. That way the linker can resolve all symbols
properly. The main application then also links against that shared library
to be able to load the plugins and use them via the public interface
exposed in the library.

Andreas

-- 
You will get what you deserve.



More information about the Qt-interest-old mailing list