I’ve recently grabbed UnrealEngine-5.3.2-release from github and am getting a ton of errors related to core engine code. Lots of types already defined errors. It’s not just a couple files that are missing #pragma once, it’s something systemic, but I haven’t the foggiest clue.
I wiped the Intermediate and Saved folders to be safe, did a clean/rebuild, force synced everything from my perforce depot, etc. I originally tried compiling in VS 2022, and then in 2019, and got the same thing. I’ve never seen anything like this with an engine upgrade.
Here’s a small sample of the errors I’m seeing (paths edited to remove project name):
UnrealEngine\Engine\Source\Runtime\Core\Public\Templates\MemoryOps.h(29): error C2953: 'UE::Core::Private::MemoryOps::TCanBitwiseRelocate': class template has already been defined
UnrealEngine\Engine\Source\Runtime\Core\Public\Templates\MemoryOps.h(39): error C2995: 'void DefaultConstructItems(void *,SizeType)': function template has already been defined
UnrealEngine\Engine\Source\Runtime\Core\Public\Templates\MemoryOps.h(39): note: see declaration of 'DefaultConstructItems'
UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\Fork.h(16): error C2011: 'EForkProcessRole': 'unsigned enum' type redefinition
Strange because looking though the source TCanBitwiseRelocate in memoryOps .h is actually defined in a different line (tempate definition is broken up on line 17 - 18)
So that error is mentioning line 29 because that’s the line of the end of the struct definition (17-29). That file is identical for me to the one that you attached.
My process was per usual when doing an engine upgrade with perforce - I downloaded the source, deleted all from my current local engine depot directory, copied the new Engine files in, then ran a “reconcile offline work”, then submitted the changes.
I have my game project setup with a different perforce stream, so there’s an engine stream and a game project stream, the game project stream imports a branch of the engine stream. So I did have to merge in the new 5.3.2 source, and then I deleted the game’s engine directory and ran a force sync for the engine stream. And then finally ran the Setup.bat, which succeeded.
I’m guessing something got messed up during the merge step…
I’ve tested this with a fresh download of 5.3.2 and 5.3.0 as well, same thing. Is something messed up with my visual studio environment? I installed VS 2022 to use that originally and then back to 2019, same errors for both. I’m at a loss as to what this might be.