Iris UNetObjectFilter (custom dynamic filter) linker error

Hi,

Official documentation about Iris is rather sparse (and as I noticed in several instances, slightly outdated). Epic is very quiet about Iris, hopefully it won’t be silently abandonned as it is very useful for what I’m planning for my project :face_without_mouth:.

I’m using 5.4.4 and am trying to make my own dynamic filter:

I’m stuck even before being able to start. Visual Studio outputs some linker error, even though everything looks fine to me:

1>Module.UnrealBlox.2.cpp.obj : error LNK2019: unresolved external symbol "private: static class UClass * __cdecl UNetObjectFilter::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@UNetObjectFilter@@CAPEAVUClass@@XZ) referenced in function "public: static class UClass * __cdecl UNetObjectFilter::StaticClass(void)" (?StaticClass@UNetObjectFilter@@SAPEAVUClass@@XZ)
1>Module.UnrealBlox.2.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl UNetObjectFilter::UNetObjectFilter(class FVTableHelper &)" (??0UNetObjectFilter@@QEAA@AEAVFVTableHelper@@@Z) referenced in function "class UObject * __cdecl InternalVTableHelperCtorCaller<class UBloxNetObjectFilter>(class FVTableHelper &)" (??$InternalVTableHelperCtorCaller@VUBloxNetObjectFilter@@@@YAPEAVUObject@@AEAVFVTableHelper@@@Z)
1>Module.UnrealBlox.2.cpp.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl UNetObjectFilter::~UNetObjectFilter(void)" (??1UNetObjectFilter@@UEAA@XZ) referenced in function "public: virtual __cdecl UBloxNetObjectFilter::~UBloxNetObjectFilter(void)" (??1UBloxNetObjectFilter@@UEAA@XZ)
1>E:\Documents\repos\UnrealBlock\Plugins\UnrealBlox\Binaries\Win64\UnrealEditor-UnrealBlox.dll : fatal error LNK1120: 3 unresolved externals

I’m using the following in my module build.cs:

SetupIrisSupport(Target);

So it is already adding “IrisCore” to the private dependency modules. I also tried adding it to the public dependency modules instead, frantically deleting Intermediates/Binaries and regenerating the VS files for the project along the way, to no avail.

Here is my header file:

#pragma once

#include "Iris/ReplicationSystem/Filtering/NetObjectFilter.h"

#include "BloxNetObjectFilter.generated.h"

UCLASS()
class UBloxNetObjectFilter : public UNetObjectFilter
{
	GENERATED_BODY()

protected:

	// UNetObjectFilter interface
	virtual void OnInit(FNetObjectFilterInitParams& Params) override;
	//virtual void AddConnection(uint32 ConnectionId) override;
	//virtual void RemoveConnection(uint32 ConnectionId) override;
	virtual bool AddObject(uint32 ObjectIndex, FNetObjectFilterAddObjectParams& Params) override;
	virtual void RemoveObject(uint32 ObjectIndex, const FNetObjectFilteringInfo& Info) override;
	virtual void UpdateObjects(FNetObjectFilterUpdateParams& Params) override;
	//virtual void PreFilter(FNetObjectPreFilteringParams&) override;
	virtual void Filter(FNetObjectFilteringParams& Params) override;
	//virtual void PostFilter(FNetObjectPostFilteringParams& Params) override;
	
};

I can also use other classes/typedefs from “Iris/ReplicationSystem/Filtering/NetObjectFilter.h” (such as UE::Net::FNetObjectFilterHandle) without linking errors so I guess the issue lies with the UNetObjectFilter class itself.

Any idea?

My bad, the issue is that you can’t use UCLASS on this (and I don’t need to actually).

Well, now I get an ensure about Iris not finding my class, even though I followed the steps described on the linked page in the OP. I submitted a bug report.

I was able to replicate this in a blank project and still get errors, and I’ve been trying a few times already so unless I made typing errors every time, this just isn’t working.

[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: === Handled ensure: ===
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: 
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: Ensure condition failed: NetObjectFilterClass != nullptr  [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Experimental\Iris\Core\Private\Iris\ReplicationSystem\Filtering\ReplicationFiltering.cpp] [Line: 2455] 
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: NetObjectFilter class is not a NetObjectFilter or could not be found: /Script/MyProject.MyDynamicFilter
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: Stack: 
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffac4f35858 UnrealEditor-IrisCore.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffac4fbc5b5 UnrealEditor-IrisCore.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffac4fbcdb5 UnrealEditor-IrisCore.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffac4fb2677 UnrealEditor-IrisCore.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa34f8d44 UnrealEditor-Engine.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa3514e24 UnrealEditor-Engine.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffa688179d8 UnrealEditor-OnlineSubsystemUtils.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffa688196cd UnrealEditor-OnlineSubsystemUtils.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa43b3e58 UnrealEditor-Engine.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa2cd39ca UnrealEditor-Engine.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa2d17218 UnrealEditor-Engine.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa078834d UnrealEditor-UnrealEd.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa07b3a09 UnrealEditor-UnrealEd.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa07891fc UnrealEditor-UnrealEd.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa07d3496 UnrealEditor-UnrealEd.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa07d760e UnrealEditor-UnrealEd.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa07d6c0e UnrealEditor-UnrealEd.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa003c4a0 UnrealEditor-UnrealEd.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffaa0cbf6b6 UnrealEditor-UnrealEd.dll!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ff74a708e0b UnrealEditor.exe!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ff74a72e33c UnrealEditor.exe!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ff74a72e42a UnrealEditor.exe!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ff74a7318a4 UnrealEditor.exe!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ff74a7470c4 UnrealEditor.exe!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ff74a74a37a UnrealEditor.exe!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffb1559e8d7 KERNEL32.DLL!UnknownFunction []
[2025.04.19-18.59.26:430][431]LogOutputDevice: Error: [Callstack] 0x00007ffb16db14fc ntdll.dll!UnknownFunction []

Did you manage to resolve this? I am running into the same problem right now.

Sadly, no. I did report the bug, though (but had no further communication since). If you want, you can do the same, maybe it will help get a solution faster:
https://www.unrealengine.com/en-US/support/report-a-bug

In my case I wanted to build a filter that kinda acts like the existing spatial grid filter, but optimised for my project (which is cell-based already, so I could make a very efficient custom filter). Using the existing one is okay for now. Putting this here in case this is helpful:

UE::Net::FNetObjectFilterHandle FilterHandle = ReplicationSystem->GetFilterHandle(FName("Spatial"));