Ver código fonte

Tell the QPluginLoader to globally export all external symbols.

Without this flag, older gcc versions do not make all external
symbols and RTTI information available to other shared libraries.
This may result in dynamic_cast calls returning 0, when casting
between objects from different libraries.
Sascha Zelzer 14 anos atrás
pai
commit
ac865fe516
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      Libs/PluginFramework/ctkPluginPrivate.cpp

+ 4 - 0
Libs/PluginFramework/ctkPluginPrivate.cpp

@@ -48,6 +48,10 @@ ctkPluginPrivate::ctkPluginPrivate(
   //TODO
   //checkCertificates(pa);
 
+  // Older gcc versions need to be told to make external symbols and RTTI information
+  // available to other libraries when loading a library with dlopen
+  pluginLoader.setLoadHints(QLibrary::ExportExternalSymbolsHint);
+
   checkManifestHeaders();
 
   pluginDir = fwCtx->getDataStorage(id);