Plugins are files that attach to a parent program and extends its functionality, Many GUI frameworks are known to support and require plugins, a good example of such is the QT GUI Framework popularly used for creating multiplatform user interface applications. Creating portable executables with plugins is always difficult, even the good old static compilation is known to break plugins. ELFex can create portable executables with all its plugins included without any problem.

In this guide we will create a GUI application with Qt, and demonstrate how its plugins can be embedded into the output executable

Assume there is a GUI application created using Qt called "painter". For painter to run, it must have the following directory structure in its path

	
  painter
  libQt5Core.so.5
  libQt5Gui.so.5
  libQt5Widgets.so.5
  platforms/
  	|
  	|--- libqxcb.so
  	|--- libpnp_extrafilters.so
  	+--- libpnp_basictools.so
	

In the directory structure above "painter" is the main executable, "libQt5Core.so.5, libQt5Gui.so.5, libQt5Widget.so.5" are the dependencies, and "libqxcb.so, libpnp_extrafilters.so and libpnp_basictools.so" are the plugins files which are located in the "Platforms" directory. This structure implies that the "platform" directory with its plugins (libqxcb.so, libpnp_extrafilters.so and libpnp_basictools.so) must be in the path of the "painter" executable for it to function.

So to create a portable version of "painter" with all its plugins included, the executable and its plugins need to be imported using the "Add Directory" in the manner shown below

Notice "painter" was imported using the "Browse" button, then to add the "platform" plugin folder, we simply located and added the directory using the "Add Directory" button. Once this is done the plugin directory will be parsed and all its plugins and dependencies will be detected and added by ELFex parser, At this point all that is needed is to "Pack and Link".

Its really that simple to add plugins, In the next section we will show you how to add data files