Developing plugins

Extensive example

The example in $CUBE_INSTALL_PREFIX/share/doc/cube/example/gui/plugin-demo uses all major functions of PluginServices. It contains functions to handle

  • settings, global preferences e.g. number formats
  • further tab functions
  • selections
  • menus, context menus and toolbars
  • global values to communicate with other plugins
See also

Problems loading plugins

If the plugin doesn't load, start cube with -verbose to get further information. The most likely reason is an undefined reference:

plugin /opt/cube/lib64/cube-plugins/ is not a valid
CubePlugin version cubeplugin/1.1
Cannot load library /opt/cube/lib64/cube-plugins/
(undefined symbol: _ZN13SimpleExample10cubeClosedEv)

If we remove the definition of the method cubeClosed() in SimpleExample.cpp, the plugin is created without errors, but it cannot be loaded. cube -verbose shows the error message above.

When building plugins, it is important to ensure that the plugin is configured in the same way as cube. A plugin build with incompatible options shows the following error:

Plugin verification data mismatch in '/opt/cube/lib64/cube-plugins/'

The same compiler, the same Qt library and the same configuration options have to be used. Only plugins which are created using a Qt library with a lower minor version can also be loaded.

Scalasca     Copyright © 1998–2015 Forschungszentrum Jülich, Jülich Supercomputing Centre