UE_5.7\Engine\Binaries\Win64\UnrealEditor-Engine.dll less ANoPawnPlayerController member functions?

UE_5.7\Engine\Binaries\Win64\UnrealEditor-Engine.dll

less ANoPawnPlayerController member functions?

2> 正在创建库 E:/devel/Unreal_Projects/test_bugs/Intermediate/Build/Win64/x64/UnrealEditor/Development/test_bugs/UnrealEditor-test_bugs-0001.lib 和对象 E:/devel/Unreal_Projects/test_bugs/Intermediate/Build/Win64/x64/UnrealEditor/Development/test_bugs/UnrealEditor-test_bugs-0001.exp
2>[6/7] Link [x64] UnrealEditor-test_bugs-0001.dll
2>Module.test_bugs.gen.cpp.obj : error LNK2001: 无法解析的外部符号 “public: virtual void __cdecl ANoPawnPlayerController::ServerEnableReplicationToConnection_Implementation(bool)” (?ServerEnableReplicationToConnection_Implementation@ANoPawnPlayerController@@UEAAX_N@Z)
2>Module.test_bugs.gen.cpp.obj : error LNK2001: 无法解析的外部符号 “public: virtual void __cdecl ANoPawnPlayerController::ServerSetViewTargetPosition_Implementation(struct UE::Math::TVector)” (?ServerSetViewTargetPosition_Implementation@ANoPawnPlayerController@@UEAAXU?$TVector@N@Math@UE@@@Z)
2>Module.test_bugs.gen.cpp.obj : error LNK2019: 无法解析的外部符号 “public: __cdecl ANoPawnPlayerController::ANoPawnPlayerController(class FObjectInitializer const &)” (??0ANoPawnPlayerController@@QEAA@AEBVFObjectInitializer@@@Z),函数 “void __cdecl InternalConstructor(class FObjectInitializer const &)” (??$InternalConstructor@VAMyNoPawnPlayerController@@@@YAXAEBVFObjectInitializer@@@Z) 中引用了该符号
2>Module.test_bugs.gen.cpp.obj : error LNK2001: 无法解析的外部符号 “public: virtual void __cdecl ANoPawnPlayerController::PostInitializeComponents(void)” (?PostInitializeComponents@ANoPawnPlayerController@@UEAAXXZ)
2>Module.test_bugs.gen.cpp.obj : error LNK2001: 无法解析的外部符号 "public: virtual class AActor * __cdecl ANoPawnPlayerController::GetViewTarget(void)const " (?GetViewTarget@ANoPawnPlayerController@@UEBAPEAVAActor@@XZ)
2>Module.test_bugs.gen.cpp.obj : error LNK2001: 无法解析的外部符号 "public: virtual class UNetConnection * __cdecl ANoPawnPlayerController::GetNetConnection(void)const " (?GetNetConnection@ANoPawnPlayerController@@UEBAPEAVUNetConnection@@XZ)
2>E:\devel\Unreal_Projects\test_bugs\Binaries\Win64\UnrealEditor-test_bugs-0001.dll : fatal error LNK1120: 6 个无法解析的外部命令

i checked UE_5.7\Engine\Binaries\Win64\UnrealEditor-Engine.dll

result is

D:\Program_Files\Epic Games\UE_5.7\Engine\Binaries\Win64>dumpbin /exports UnrealEditor-Engine.dll | findstr NoPawnPlayerController

803 322 01ACA890 ??0ANoPawnPlayerController@@QEAA@AEAVFVTableHelper@@@Z
3877 F24 01AD0EF0 ??1ANoPawnPlayerController@@UEAA@XZ
23349 5B34 043A0BA8 ?NumNoPawnPlayerControllersForReplication@Metric@Net@UE@@3VFName@@B
34088 8527 01AB80B0 ?Z_Construct_UClass_ANoPawnPlayerController@@YAPEAVUClass@@XZ
34089 8528 01B3F9F0 ?Z_Construct_UClass_ANoPawnPlayerController_NoRegister@@YAPEAVUClass@@XZ

but these six functions exist in PlayerController.cpp

nin hao,

this types of link errors are usually caused by a missing dependency

in your game.build.cs add the required module

 PublicDependencyModuleNames.AddRange(new string[]
        {
            "Core",
            "Whatever the module name is",
        });

i imagine is something with ai

This is my build.cs


// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class test_bugs : ModuleRules
{
public test_bugs(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

	PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" });

	PrivateDependencyModuleNames.AddRange(new string[] {  });

	// Uncomment if you are using Slate UI
	// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
	
	// Uncomment if you are using online features
	// PrivateDependencyModuleNames.Add("OnlineSubsystem");

	// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
}

}


Have you tested it?!
When using UE5.7 to create an empty project and then creating a subclass of ANoPawnPlayerController, this issue occurs. The build.cs module is the default, and the dumpbin above has already indicated the results.

Furthermore, I checked APlayerController again in “UE_5.7/Engine/Binaries/Win64/UnrealEditor-Engine.dll” using “dumpbin”. This class matches the definition in PlayerController.cpp.
Given that the member functions of ANoPawnPlayerController and APlayerController are implemented in the same CPP file, it can be inferred that in 99.999% of cases, the member functions of ANoPawnPlayerController should also be in UnrealEditor-Engine.dll.

So I deduce that in 99.999% of cases, this is a bug in the release build; the released DLL does not correspond to the source code.

Additionally, the ANoPawnPlayerController type works fine under UE5.6; the source code and UnrealEditor-Engine.dll match.

no because i don’t have your code. you need to test it.

i don’t know what modules you need to include. but thanks for sharing your code.

unreal strips unused or private symbols on other modules.

it can be that you haven’t put the correct export tag on the module, or using something without the correct export tag. or you are missing something.

there’s also the chance there’s a problem with your local files, e.g. try deleting intermediate and saved (back up first).

please share your .h AND .cpp for that ANoPawnPlayerController files