How to turn an existing C++ class into a plugin?

Yes, I’ve just got stuck exactly on this. I tried to package the plugin from the plugins window, without much success. I get an error if I send the plugin to a friend. It’s something regarding the modules but I don’t remember exactly what. Anyway. where do I find the name of the plugin module I’ve created? I’ve simply tried to add name of my module all caps without any spaces suffixed by _API in front of the class name, but no luck. So far I have a class in my plugin’s folder source folder without that macro.