Explorar el Código

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 hace 14 años
padre
commit
ac865fe516
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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);