I’ve run into a problem with packaging my plugin. It compiles and works fine in the project I created it in, but when I attempt to package, it gives me the error:
...Source\MyPlugin\Private\MyPlugin.cpp(15): error C2061: syntax error: identifier 'MyPlugin'
This is followed by a lot of errors relating to engine source:
UATHelper: Package Plugin Task (Windows): C:\Users\admin\OneDrive\Desktop\TestPackage\MyPlugin\HostProject\Plugins\MyPlugin\Source\MyPlugin\Private\MyPlugin.cpp(15): error C2061: syntax error: identifier 'MyPlugin'
UATHelper: Package Plugin Task (Windows): C:\Unreal\UE_5.1\Engine\Intermediate\Build\Win64\UnrealGame\Inc\Engine\UHT\LightComponentBase.generated.h(12): error C2144: syntax error: 'FLinearColor' should be preceded by ';'
UATHelper: Package Plugin Task (Windows): C:\Unreal\UE_5.1\Engine\Intermediate\Build\Win64\UnrealGame\Inc\Engine\UHT\LightComponentBase.generated.h(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
UATHelper: Package Plugin Task (Windows): C:\Unreal\UE_5.1\Engine\Intermediate\Build\Win64\UnrealGame\Inc\Engine\UHT\LightComponentBase.generated.h(12): error C2086: 'FLinearColor ': redefinition
UATHelper: Package Plugin Task (Windows): C:\Unreal\UE_5.1\Engine\Source\Runtime\Core\Public\Math\Color.h(47): note: see declaration of 'FLinearColor'
UATHelper: Package Plugin Task (Windows): C:\Unreal\UE_5.1\Engine\Source\Runtime\Engine\Classes\Components\LightComponent.h(393): error C2027: use of undefined type 'FLinearColor'
UATHelper: Package Plugin Task (Windows): C:\Unreal\UE_5.1\Engine\Intermediate\Build\Win64\UnrealGame\Inc\Engine\UHT\LightComponent.generated.h(15): note: see declaration of 'FLinearColor'
UATHelper: Package Plugin Task (Windows): C:\Unreal\UE_5.1\Engine\Source\Runtime\Engine\Classes\Components\LightComponent.h(392): error C2027: use of undefined type 'FLinearColor'
UATHelper: Package Plugin Task (Windows): C:\Unreal\UE_5.1\Engine\Intermediate\Build\Win64\UnrealGame\Inc\Engine\UHT\LightComponent.generated.h(15): note: see declaration of 'FLinearColor'
// etc. etc.
The line the original error in the list refers to is:
IMPLEMENT_MODULE(FMyPluginModule, MyPlugin)
I haven’t made any changes to this line since I created the plugin.
I’m having trouble figuring out what the issue is.