Cannot open source file "generated.h"

THIS was it in my case. I was using a class from my other module, but I forgot to add the module as a dependency (in the ‘.Build.cs’). In my case, I used the class only in the .cpp, so I added it as a private dependency and then I could build again successfully.

The error message does not tell you this, but we can look at the output log, to see, WHERE the error occured. In my case it was like:

[1/13] Compile [x64] MyCppFile.cpp
11>MyClass.h(5): Error C1083 : Cannot open include file: ‘MyClass.generated.h’: No such file or directory

So I knew I had to look at the MyCppFile.cpp and include the module, where “MyClass” is.