I got following error during building UE4.11p5 from source at VS2015 Community Update 1:
1> Module.GameplayTasks.cpp
1> Module.GameplayAbilitiesEditor.cpp
1>c:\GIT\UnrealEngine\Engine\Source\Runtime\GameplayTasks\Private\GameplayTask.cpp(3): error C4426: optimization flags changed after including header, may be due to #pragma optimize()c:\GIT\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Inc\GameplayTasks\GameplayTasks.generated.cpp(8): error C4426: optimization flags changed after including header, may be due to #pragma optimize()
1>
1>c:\GIT\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\GameplayTasks\Module.GameplayTasks.cpp(3): error C4426: optimization flags changed after including header, may be due to #pragma optimize()
1>c:\GIT\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\GameplayAbilitiesEditor\Module.GameplayAbilitiesEditor.cpp(21): error C4426: optimization flags changed after including header, may be due to #pragma optimize()
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: c:\GIT\UnrealEngine\Engine\Binaries\Win64\UE4Editor-GameplayTasks.dll
I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.
I can confirm this issue on current master and promoted branches. It is directly related to breaking changes introduced in VS2015 Update 1 that are explained here Visual C++ What's New 2003 through 2015 | Microsoft Docs (#pragma optimize() extends past end of header file). The VS2013 compilation is unaffected and works without problems.
We’re hitting the same thing, but only in one configuration; we clearly grabbed our latest drop a bit too early.
What was the specific fix for this? Was it a change to the core macros and/or compilation settings, or were there some engine headers that were leaking optimize settings which have now been cleaned up?
Having this issue myself now as well. 4.12.4. It was fine when I was in “Development Editor”,but switching to “DebugGame Editor” now I am running into this issue.
EDIT: I was actually wrong. We are already using 4.12.5
Updated to Update 3 and still having this issue. We are currently on 4.12.4 and I don’t have the option in the short term of moving to 4.12.5. We are longer term (in the next few weeks) going to move to 4.13 but I have bugs I need to get fixed in our tools now on 4.12.4
Is there any information on what I can change in 4.12.4 to get this to compile? I really need proper debugging to track down a tricky bug.
The error is exactly as stated above: error C4426: optimization flags changed after including header, may be due to #pragma optimize()
Now interestingly the compiler is calling out one of OUR files with this error, but I assume it is simply a carry over from something we are including since we aren’t doing anything special in our files.