How can I implement a new UFactory as a plugin?

I’m trying to add a new UFactory by means of a plugin.

I copied BlankPlugin, added a Classes folder, in there put MyFactory.h and in Private put MyFactory.cpp, I then made a UMyFactory class inheriting from UFactory and implementing FactoryCreateNew, much like the UForceFeedbackEffectFactory.

I figured I needed access to a private module for UnrealEd, so I added that to my Build.cs, as well as include CoreUObject on the public modules.

After all this, the compiler should give me a working plugin (regardless if the FactoryCreateNew actually returns something useful), but the compiler is spitting errors at me like crazy:

Error 93 error C2061: syntax error : identifier 'FFrame' d:\projecten\epic games\ue4 github\engine\source\runtime\coreuobject\public\uobject\UObject.h 903 1 MyProject

About 100 times. What am I missing to make this compile (at the very least)?

As a sidenote: I’m trying to add support for exporting and importing PhysicsAssets, it seems it’s built into the engine, but you need a Factory to specifically handle it, which is what I’m trying to add. Other than that, it’s also to figure out how Editor plugins work.

I had this same sort of problem, and I solved it by adding an include for UnrealEd.h in the cpp file

I’m trying to create the same thing. I know this is an old post. But have you solved this issue?