Shipping Build and Include What You Need

I changed my project to be set up for Include What You Need.

I’ve been having trouble for a while with packaging my project. Turns out it’s the shipping build that fails. When I build the editor it works perfectly. I normally use the Debug Editor configuration and launch from within Visual Studio.

When I build shipping it says things like AActor and UInterface aren’t found and I have to include the files for them. But the amount of code that doesn’t compile is quite overwhelming.

Examples:

error C2504: 'UInterface': base class undefined
error C2504: 'AActor': base class undefined

I tried including Engine.h instead of CoreMinimal.h just to see what happens and it compiles fine. I’m still debating if I should just include Engine.h in all my game modules. IWYN is supposed to be for the benefit of compiling the engine quicker anyway.

I also read that editor builds have a different set of includes and modules so that’s why it compiles fine. I’m not sure what ends up being included automatically for me to cause it to work.

In the end, I’m all for spending some time fixing up my entire project to work properly with IWYN but I want to go about it the smartest way. I’ve always coded with IWYN style in past C++ projects and am definitely all for doing it with Unreal.