'UpdateCollisionProfile' : is not a member of 'USkeletalMeshComponent'

Hello,

I can play my Game in PIE, but when launching or packaging I get this error:

LogPlayLevel: UnrealBuildTool: C:\Users\Me\Desktop\Project\Source\Project\MyClass.cpp(558) : error C2039: 'UpdateCollisionProfile' : is not a member of 'USkeletalMeshComponent'
LogPlayLevel: UnrealBuildTool:         C:\Program Files\Epic Games\4.9\Engine\Source\Runtime\Engine\Classes\Components/SkeletalMeshComponent.h(280) : see declaration of 'USkeletalMeshComponent'

This error is caused by a call in one of my C+±Class-Functions:

	myMesh->UpdateCollisionProfile();

where myMesh is a “USkeletalMeshComponent”.

The outputlog says, i should check if “UpdateCollisionProfile” is declared in " C:\Program Files\Epic Games\4.9\Engine\Source\Runtime\Engine\Classes\Components/SkeletalMeshComponent.h(280)".
It seems to be declared in line 819:

	virtual void UpdateCollisionProfile() override;

but the error still occours.
Does anyone know a solution, or has a hint for this problem?

Thank you for any feedback,

Hi, UpdateCollisionProfile is defined within a #if WITH_EDITOR preprocessor so it can only be used while compiling an Editor version of the engine.

You may change your code with something like this

#if WITH_EDITOR
    myMesh->UpdateCollisionProfile();
#endif // WITH_EDITOR

Thank you, i guess this is the issue.
I just removed the line, it seemed not to be necessary for my function.