Linker error when attempting to serialize FVector_NetQuantize10 in source builded ue5.0.3

Hi. Attempting to update from ue4 to ue5 and I got a weird linker problem:

1>Module.MyGame.2_of_3.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl UE::Net::WriteQuantizedVector(int,struct UE::Math::TVector<double> const &,class FArchive &)" (__imp_?WriteQuantizedVector@Net@UE@@YA_NHAEBU?$TVector@N@Math@2@AEAVFArchive@@@Z) referenced in function "bool __cdecl SerializePackedVector<10,24>(struct UE::Math::TVector<double> &,class FArchive &)" (??$SerializePackedVector@$09$0BI@@@YA_NAEAU?$TVector@N@Math@UE@@AEAVFArchive@@@Z)

1>Module.MyGame.2_of_3.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl UE::Net::ReadQuantizedVector(int,struct UE::Math::TVector<double> &,class FArchive &)" (__imp_?ReadQuantizedVector@Net@UE@@YA_NHAEAU?$TVector@N@Math@2@AEAVFArchive@@@Z) referenced in function "bool __cdecl SerializePackedVector<10,24>(struct UE::Math::TVector<double> &,class FArchive &)" (??$SerializePackedVector@$09$0BI@@@YA_NAEAU?$TVector@N@Math@UE@@AEAVFArchive@@@Z)

The minimal example to reproduce would be to call FVector_NetQuantize10::NetSerialize():

	FArchive Ar;
	UPackageMap* PackageMap = nullptr;
	bool bSuccess;
	FVector_NetQuantize10 Vec;
	Vec.NetSerialize(Ar, PackageMap, bSuccess);

As far as i can see, some libs are missing from my installed build of 5.0.3. Build was assembled with the next line:

.\Engine\Binaries\DotNET\AutomationTool\AutomationTool.exe BuildGraph 
-target="Make Installed Build Win64" 
-script="Engine/Build/InstalledEngineBuild.xml" 

-set:HostPlatformEditorOnly=true 

-set:GameConfigurations=Development 

-set:WithDDC=false 
-set:EmbedSrcSrvInfo=false 
-set:WithFullDebugInfo=false 

-clean

Of course i can temporary workaround it with using regular FVector, but it’s only a workaround. Any ideas what could go wrong here?

1 Like

I have exactly the same issue, all of the four NetQuantize functions cause the same issue. I thought it was something I did, just spent an hour reverting code, now I know it was not just me.
I am on UE 5.0.3, copied the serialization function directly from UE source and it all works fine if I change to standard Vector too.

1 Like

Someone called Laura on the UnrealSlackers Discord helped me, you need to add “NetCore” to your projects Build.cs

2 Likes

Thanks, this works. Though it’s weird that on doc page this function is still marked as a part of “Engine” module.

From what I understand, is that NetQuantize (from NetSerialization.h) is in the Engine module, but it calls ReadQuantizedVector (shown in the linker error), which is in a different header file, and it is that function that is in the NetCore module.

1 Like