Relocation error when loading shared object
Well that's about it. I get
/home/nye/Programming/C++/qtdaemon/examples/daemon/customcontrol/customcontroller/customcontroller: relocation error symbol _ZTVN8QtDaemon17QDaemonControllerE, version Qt_5 not defined in file libQt5Daemon.so.0 with link time reference
from the loader and I'm at a loss why. The symbol is present in the library mentioned, marked as a weak object for some reason.
0000000000018a68 V _ZTVN8QtDaemon17QDaemonControllerE
Any suggestions on reason or solution?
Hi I've seen this when one .cpp includes qglobal.h and another one does not. It's the new qversiontagging.h file that defines a qt_version_tag symbol, like your Qt_5 above...
Thanks Henry! You're right the
qt_version_tagsymbol is marked as undefined, I wonder why however. I've checked, and all my headers are including
QtCore/qglobal.hthrough my own global header (where I define the export/import macros).
Now I feel really, really stupid!
So the whole problem was that the example application links against my module, but when the loader runs it uses another copy of the library (and old one). The old copy for unfathomable reasons I'd installed to the system location, and because the library is binary compatible it would work ... mostly ... until I started changing the ABI and the example application links against the new and changed binary interface ... thus we arrive here ...
Ha I know the feeling, like me before, thinking ".. that stupid Qt, why doesn't this work, why are they so dumb..." oooh, it helps to run qmake again :-)