Upgrade to UE5.5 throwing errors regarding the use of native pointers.

I am upgrading my project from 5.3 to 5.5 and when I attempt to compile the project i see many errors regarding the use of native pointers.

Native pointer usage in member declaration detected [[[class UAnimMontage*]]].  This is disallowed for the target/module, consider TObjectPtr as an alternative.

I have verified the config for the UnrealHeaderTool and I believe this should not be happening. Also, when I attempt to build for UE5.4 I do not see these errors. Anyone seen this before?

1 Like

I’m also seeing this, have you had any luck getting it to build?

It’s just required now, update your pointers from:
MyPointerType* VariableName
to
TObjectPtr<MyPointerType> VariableName

It’s a lot of find and replace, but a simple update.

Here’s the solution I found, in your Editoor.Target.cs

public class TestProjectEditorTarget: TargetRules
{
	public TestProjectEditorTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Editor;

		ExtraModuleNames.AddRange(new string[] { "TestProject", "TestProjectEditor" });

		if (!bBuildAllModules)
		{
			NativePointerMemberBehaviorOverride = PointerMemberBehavior.AllowSilently;
		}
	}
}

This is the part that fixes the issue…

if (!bBuildAllModules)
		{
			NativePointerMemberBehaviorOverride = PointerMemberBehavior.AllowSilently;
		}