[4.13] Compiler Errors after transition

Hello there,

after transitioning to the new UE-Version, my project no longer compiles. I figured it has something to do with using the ConstructionHelpers for the UAnimMontage-Class (ConstructorHelpers::FObjectFinder)

But since #include “Runtime/Engine/Classes/Animation/AnimInstance.h” doesn’t work, I don’t know what to do.

Here is one of the Errors:

1>C:\Program Files (x86)\Epic Games\4.13\Engine\Source\Runtime\CoreUObject\Public\UObject\ConstructorHelpers.h(105): error C2664: 'void ConstructorHelpers::ValidateObject(UObject *,const FString &,const TCHAR *)': cannot convert argument 1 from 'UAnimMontage *' to 'UObject *'
1>  C:\Program Files (x86)\Epic Games\4.13\Engine\Source\Runtime\CoreUObject\Public\UObject\ConstructorHelpers.h(105): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>  C:\Program Files (x86)\Epic Games\4.13\Engine\Source\Runtime\CoreUObject\Public\UObject\ConstructorHelpers.h(98): note: while compiling class template member function 'ConstructorHelpers::FObjectFinder<UAnimMontage>::FObjectFinder(const TCHAR *)'
1>  C:\UnrealProjects\StruggleOfMages\Source\StruggleOfMages\SomPickup_Food.cpp(24): note: see reference to function template instantiation 'ConstructorHelpers::FObjectFinder<UAnimMontage>::FObjectFinder(const TCHAR *)' being compiled
1>  C:\UnrealProjects\StruggleOfMages\Source\StruggleOfMages\SomPickup_Food.cpp(24): note: see reference to class template instantiation 'ConstructorHelpers::FObjectFinder<UAnimMontage>' being compiled

Thanks for your help.

Hello ,

I’m interested in looking at why this is happening. Would it be possible for you to upload one of the constructors where this error is occurring?

The following line gives me error C2664 as well:

static ConstructorHelpers::FObjectFinder<UPhysicsAsset> PA(TEXT("/Game/TestPhysicsAsset"));

Thanks for your answer, Matthew.

Here is one of the constructors (too long for posting):

link text

Nevermind. I did use the wrong include. Instead of

#include “Runtime/Engine/Classes/Animation/AnimInstance.h”

you have to use

#include "Runtime/Engine/Classes/Animation/AnimMontage.h"

Thanks though.

Thank you . Including the following line solves my problem as well. It was not needed in version 4.12 though.

#include "Runtime/Engine/Classes/PhysicsEngine/PhysicsAsset.h"