Permanent problem with generating generated.h files

Recently I migrated some of my C++ Files (4.15) to an empty Project (4.18), following the steps in this link.
I changed all the classnames, includes etc. and got it to compile eventually.

Now, when I mess something up in my code and try to build it, I basically only get “cannot open source file myClass.generated.h” errors. The problem is getting all those errors makes it really hard to find the piece of code that actually lead to the error.

When I think I found the actual problem in my code it still doesnt compile. I usually close the engine, delete the binaries, build the VS project files until suddenly I get it to compile again.

I don’t really get why this is happening, is this a 4.18 thing or does it have to do with manually moving the class files to another project? While developing for 4.15 I never faced a problem like that.

Any kind of help would be appreciated!

I have exactly same problem but only in Visual Studio Code. Any suggestions?

Have you tried regenerating your project files?

It seems like missing even a single include file results in a number of weird compile errors. In the end I just had to include some files, so the generated header files could be generated! Switching to the output section in visual studio instead of using the error list helped to find out what was causing the compile errors.

check out my answer, hope it helps!

I’ll try, thanks!