I was moving around .h and .cpp files and suddenly got this type of error (“Duplicate leaf header name found: %s (original: %s)”) during the compilation for several moved headers. Now I am not able to compile the project at all. I tried clearing “Intermediate” directory, regenerating project files - nothing helped me. Currently I am working with the distributed “baked” version of the engine (not source).
I guess this UObject headers are somewhere referenced and cached. This way to fix it I just need to remove the cache they are stored at.
Has anybody faced the same issue? Have you fixed it, how?
UPD 1:
I have found that a list of headers to be processed is comming from *.uhtmanifest file in the Intermediate/Build/… This file is generated each time during the project build before UnrealHeaderTool parses it, so it can’t be easily modified to remove duplications.
Currently I am searching for the place where it is generated and what data it uses to form *.uhtmanifest file.
I just had the same problem, and by paying closer attention I figured out I had duplicated files, see image bellow (which occured because I moved them to a different folder from remote but the original files were not deleted by VCS).
If you pay closer attention to the error message, you’ll see it’s pointing out the locations of each of the 2 files. For me, one is in the Framework folder while the other one is directly in Project folder :