If you get compile error in Unreal 4.26 Creating MainMenu class

For me Unreal 4.26 incorrectly generated the include for MainMenu.h it added the sub folder instead of leaving it relative which causes the build to fail as it can’t find MainMenu.h

 fatal error C1083: Cannot open include file: 'MenuSystem/MainMenu.h': No such file or directory

If this happens to you open MainMenu.cpp and change the include to

#include "MainMenu.h"

Screenshot 2020-12-29 194906

Also if you just build in visual studio it didn’t add the folder structure and class to the unreal GUI I did the compile again from the Unreal UI and everything updated.

11 Likes

Thanks! I had this same issue using Unreal 5.0.3.

Privacy & Terms