To be able to include MFnPlugin.h in several places you need to do:
//- MNoVersionString is needed on MacOS and Linux to avoid multiple MApiVersion definition
//- MNoPluginEntry is needed on Windows platform to avoid multiple DllMain definition
#define MNoVersionString
#define MNoPluginEntry
#include <maya/MFnPlugin.h>
Official doc talks about MNoVersionString but forgets about MNoPluginEntry this should be added:
https://help.autodesk.com/view/MAYAUL/2020/ENU/?guid=Maya_SDK_MERGED_cpp_ref_class_m_fn_plugin_html
(I found out about this in this blog: https://around-the-corner.typepad.com/adn/2013/01/include-or-precompiled.html )
@tj.galda