You may encounter the following errors while developing in unreal engine.
- error: expected class name
error: unknown type name ‘UInterface’
error: constructor initializer ‘Super’ (aka ‘int’) does not name a class
When they occur
Usually this error will occur while attempting to package a plugin or project for Android or IOS but not for windows or desktops.
Solution
You need to explicitly include the header for each class you use in your code.
Taking UInterface as an example:
- You need to #include “UObject/Interface.h”
Visual Studio will not complain when you use UInterface without explicitly including this header, but Unreal Engine will complain while packaging…