Cannot open source file name.generated.hc

Since this thread is the first result when I google this problem, I figured I will also provide my solution to this problem.

For me, the problem was that I accidentally included the class prefix in the file name (i.e. I had a class called “FMyStruct”, and I accidentally called the file name “FMyStruct.h”). This breaks the build system, eventually I noticed this problem and corrected it by changing the file name to “MyStruct.h” (note that it no longer includes the ‘F’ prefix).