[UE] Solution to package error after adding special-shaped buttons

According to this article , a special-shaped button was added to the project, but two errors occurred when packaging. record the solution

The first error:

UATHelper: Packaging (Windows):   ERROR: Unable to instantiate module 'UnrealEd': Unable to instantiate UnrealEd module for non-editor targets.
UATHelper: Packaging (Windows):          (referenced via Target -> *.Build.cs -> UMGEditor.Build.cs -> Sequencer.Build.cs)

This error is because UMGEditor is added to the project, and this configuration is only run in the editor.

Solution: find 项目名.uprojectthe file and delete UMGEditor

The second error:

UATHelper: Packaging (Windows):     D:...\*.cpp:84:23: error: static_cast from 'unsigned char *' to 'FColor *' is not allowed
UATHelper: Packaging (Windows):             FColor* MazeLayout = static_cast<FColor*>((AdvancedHitTexture->PlatformData->Mips[0]).BulkData.Lock(LOCK_READ_ONLY));

Solution: change static_cast to reinterpret_cast.

I checked the difference between the two: simply speaking, the former converts similar types to precision. The latter does not perform any truncation and filling operations at all, and directly performs one-to-one bit copying

reference article

Guess you like

Origin blog.csdn.net/weixin_44559752/article/details/127026720