Can't upgrade 4.14 to 4.15 [Compile error]

It compiles fine on 4.14, but won’t go to 4.15

Wall of text ahead:

The project could not be compiled. Would you like to open it in Visual Studio?

Running C:/Program Files/Epic Games/UE_4.15/Engine/Binaries/DotNET/UnrealBuildTool.exe Casey2 Development Win64 -project="C:/Users/Nathaniel/Documents/Unreal Projects/Casey2 4.15 - 2/Casey2.uproject" -editorrecompile -progress -NoHotReloadFromIDE
Creating makefile for Casey2 (no existing makefile)
Performing full C++ include scan (no include cache file)
@progress push 5%
Parsing headers for Casey2Editor
  Running UnrealHeaderTool "C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Casey2.uproject" "C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Intermediate\Build\Win64\Casey2Editor\Development\Casey2Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Reflection code generated for Casey2Editor in 7.5173796 seconds
@progress pop
Performing 13 actions (4 in parallel)
[2/13] Resource ModuleVersionResource.rc.inl
[3/13] Resource PCLaunch.rc
PCH.Casey2.cpp
Casey.cpp
Casey2GameModeBase.cpp
Casey2.cpp
CaseyHUD.cpp
Coke.cpp
Devil.cpp
C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Devil.cpp(41): warning C4996: 'USceneComponent::AttachTo': This function is deprecated, please use AttachToComponent instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
C:\Program Files\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Classes\Components/SceneComponent.h(614): note: see declaration of 'USceneComponent::AttachTo'
c:\program files\epic games\ue_4.15\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(109): error C2664: 'void ConstructorHelpers::ValidateObject(UObject *,const FString &,const TCHAR *)': cannot convert argument 1 from 'UPaperSprite *' to 'UObject *'
c:\program files\epic games\ue_4.15\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(109): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\program files\epic games\ue_4.15\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(102): note: while compiling class template member function 'ConstructorHelpers::FObjectFinder::FObjectFinder(const TCHAR *)'
C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Devil.cpp(40): note: see reference to function template instantiation 'ConstructorHelpers::FObjectFinder::FObjectFinder(const TCHAR *)' being compiled
C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Devil.cpp(40): note: see reference to class template instantiation 'ConstructorHelpers::FObjectFinder' being compiled
C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Casey.cpp(26): warning C4996: 'USceneComponent::AttachTo': This function is deprecated, please use AttachToComponent instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
C:\Program Files\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Classes\Components/SceneComponent.h(614): note: see declaration of 'USceneComponent::AttachTo'
C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Casey.cpp(39): warning C4996: 'USceneComponent::AttachTo': This function is deprecated, please use AttachToComponent instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
C:\Program Files\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Classes\Components/SceneComponent.h(614): note: see declaration of 'USceneComponent::AttachTo'
Flashlight.cpp
C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Coke.cpp(34): warning C4458: declaration of 'InputComponent' hides class member
C:\Program Files\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(332): note: see declaration of 'AActor::InputComponent'
C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Coke.cpp(50): warning C4996: 'USceneComponent::AttachTo': This function is deprecated, please use AttachToComponent instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
C:\Program Files\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Classes\Components/SceneComponent.h(614): note: see declaration of 'USceneComponent::AttachTo'
c:\program files\epic games\ue_4.15\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(109): error C2664: 'void ConstructorHelpers::ValidateObject(UObject *,const FString &,const TCHAR *)': cannot convert argument 1 from 'UPaperSprite *' to 'UObject *'
c:\program files\epic games\ue_4.15\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(109): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\program files\epic games\ue_4.15\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(102): note: while compiling class template member function 'ConstructorHelpers::FObjectFinder::FObjectFinder(const TCHAR *)'
C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Coke.cpp(49): note: see reference to function template instantiation 'ConstructorHelpers::FObjectFinder::FObjectFinder(const TCHAR *)' being compiled
C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Coke.cpp(49): note: see reference to class template instantiation 'ConstructorHelpers::FObjectFinder' being compiled
Casey2.generated.cpp
C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Flashlight.cpp(37): warning C4458: declaration of 'InputComponent' hides class member
C:\Program Files\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(332): note: see declaration of 'AActor::InputComponent'
ERROR: UBT ERROR: Failed to produce item: C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Binaries\Win64\UE4Editor-Casey2.dll
Total build time: 56.34 seconds (Local executor: 0.00 seconds)

The error says that it can’t convert UPaperSprite to UObject, which would suggest that you’re missing an include for UPaperSprite in Devil.cpp (likely due to the include-what-you-use changes).

 c:\program files\epic games\ue_4.15\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(109): error C2664: 'void ConstructorHelpers::ValidateObject(UObject *,const FString &,const TCHAR *)': cannot convert argument 1 from 'UPaperSprite *' to 'UObject *'
 c:\program files\epic games\ue_4.15\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(109): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
 c:\program files\epic games\ue_4.15\engine\source\runtime\coreuobject\public\UObject/ConstructorHelpers.h(102): note: while compiling class template member function 'ConstructorHelpers::FObjectFinder::FObjectFinder(const TCHAR *)'
 C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Devil.cpp(40): note: see reference to function template instantiation 'ConstructorHelpers::FObjectFinder::FObjectFinder(const TCHAR *)' being compiled
 C:\Users\Nathaniel\Documents\Unreal Projects\Casey2 4.15 - 2\Source\Casey2\Devil.cpp(40): note: see reference to class template instantiation 'ConstructorHelpers::FObjectFinder' being compiled

You also have several deprecation warnings, so I’d suggest you open up your project in Visual Studio (as was suggested) and fix the compile errors and warnings.

You’re better including the subset of headers you need (I’m not even sure those Classes headers still exist).

Our engine headers have been updated to include what they need, so including just PaperSprite.h should get you that type and anything that it directly needs to compile (although we do use forward declarations where possible too, to improve compile times).

Hi Jamie Dale,

So you only need to add #include “Paper2DClasses.h” to use Paper2d?

Except I do have include “PaperSpriteComponent” in Devil.cpp.

PaperSpriteComponent.h contains UPaperSpriteComponent, but your error is about UPaperSprite, which is in PaperSprite.h.