I found an error when I try to package my custom plugin on 4.27.2. Anyone know please give an example of code or how I can fix this. My Project is in C++
If you are including Windows stuff you need a “header sandwich” to instruct Unreal to to prevent the macro/define collisions. Been using this over 5+ projects and works from Unreal 4.9 to 5.1:
// put this at the top of your .h file above #includes
// UE5: allow Windows platform types to avoid naming collisions
// must be undone at the bottom of this file!
#include "AllowWindowsPlatformTypes.h"
#include "prewindowsapi.h"
… your
… header
… file
… content
// put this at the bottom of the .h file
// UE5: disallow windows platform types
// this was enabled at the top of the file
#include "PostWindowsApi.h"
#include "HideWindowsPlatformTypes.h"
There’s a few old threads about this but added it here.