There is this guide: http://qt-project.org/doc/qt-4.8/plugins-howto.html
It is totally useless, because it is missing too many crucial information. However after few hours of some research I figured out how to get somewhere:
Source code of interface .h: https://github.com/huggle/huggle3-qt-lx/blob/master/huggle/iextension.h
And .h of plugin: https://github.com/huggle/extensions/blob/master/c%2B%2B/HelloWorld/HelloWorld/helloworld.h
I managed to create an interface for plugin and applied the macro to it, then I created a plugin but as in example the plugin should be inherited from interface, I clearly need to somehow include the .h file from my project. I did that, and then I used QPluginLoader in order to load the .so file.
However I am getting this:
Failed to load (reason: Cannot load library /home/petanb/Documents/huggle3-qt-lx/huggle/extensions/libHelloWorld.so: (/home/petanb/Documents/huggle3-qt-lx/huggle/extensions/libHelloWorld.so: undefined symbol: _ZTIN6Huggle10iExtensionE))
that makes sense, the library (where I #include the .h file of my project) is clearly missing the reference to binary of my application in order to resolve it but how can I give it to that? Should I copy the application's binary, rename it to something.so and put it to /lib or something? Or what should I do?