I have written a Plugin, basically a BP Function Library, which is Windows specific. Since it requires some Windows specific includes, I have used AllowWindowsPlatformTypes.h / HideWindowsPlatformTypes.h to include the proper header files.
The Plugin works perfectly in the editor and in a packaged game, but refuses to be Packaged using the Package function from the Plugin Windows. It fails with the following error:
fatal error C1083: Cannot open include file: ‘AllowWindowsPlatformTypes.h’: No such file or directory
Also compiling the Plugin in VS works without any issues. Any ideas about what I am missing here? I am on 4.20.3.
Thanks,
Marco.
UPDATE: I have tried also to WhiteList the Win64 platform inside the Build file but it doesn’t make any difference. UPDATE2: I have tried multiple combinations of includes but eventually I always get an error that one include cannot be opened (like above)
SOLVED: see post #4 for the solution. Thanks to @kamrann for the tip that put me on the right track.
I have tried that as well earlier on but did not make any difference. To be noted that my plugin works and can be included in a packaged project, but cannot be packaged standalone from the plugin window.
Ok, I was able to solve the issue. Here is the learning.
In order to package a standalone Plugin, the includes have to be more explicit than what is required by VS or to run/package the plugin as part of a project. I had to go through all the includes that were generating an error and add to their path. For example:
I was having the same problem. Everything was fine on Visual Studio and Unreal Editor but when packaging the header files was missing.
I was able to solve adding more detail to my include paths as @vr_marco mentioned above. In my case , I changed this:
I believe I’ve found the *proper *way to solve this issue.
#include "Windows/PreWindowsApi.h"
#include "windows.h" // This works with other apis and should work when your includes include windows apis I think
#include "Windows/PostWindowsApi.h"