Can not link against FillArrayFromResponses engine function

I have a 5.3.1 project with a editor plugin (but I’ve tried just adding this code to my core game module as well) I’m trying to make that I’m trying to build on a Mac and Windows. When I added the lines:

auto container = Component->GetCollisionResponseToChannels();
TArray<FResponseChannel> responses = TArray<FResponseChannel>();
container.FillArrayFromResponses(responses);

This compiles fine, but trying to link it I get this error on Mac:

0>[2/2] Link [Apple] UnrealEditor-PhysicsSystemHelper.dylib
0>Undefined symbols for architecture arm64:
0>  "FCollisionResponseContainer::FillArrayFromResponses(TArray<FResponseChannel, TSizedDefaultAllocator<32>>&)", referenced from:
0>      FPhysicsSystemHelperModule::QueryLevel() in PhysicsSystemHelper.cpp.o
0>ld: symbol(s) not found for architecture arm64
0>clang: Error  : linker command failed with exit code 1 (use -v to see invocation)

The error on Windows is:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl FCollisionResponseContainer::FillArrayFromResponses(class TArray<struct FResponseChannel,class TSizedDefaultAllocator<32> > &)" 

How can I fix this linker error?

EXTRAS:
Here is my build.cs file for the plugin (I’ve tried Engine in both the public and private dependencies):

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

using UnrealBuildTool;

public class PluginHelper : ModuleRules
{
	public PluginHelper(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
		
		PublicIncludePaths.AddRange(
			new string[] {
				// ... add public include paths required here ...
			}
			);
				
		
		PrivateIncludePaths.AddRange(
			new string[] {
				// ... add other private include paths required here ...
			}
			);
			
		
		PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",
				// ... add other public dependencies that you statically link with here ...
			}
			);
			
		
		PrivateDependencyModuleNames.AddRange(
			new string[]
			{
				"Engine",
				"Projects",
				"InputCore",
				"EditorFramework",
				"UnrealEd",
				"ToolMenus",
				"CoreUObject",
				"Slate",
				"SlateCore",
				"PropertyEditor",
				"LevelEditor"
				// ... add private dependencies that you statically link with here ...	
			}
			);
		
		
		DynamicallyLoadedModuleNames.AddRange(
			new string[]
			{
				// ... add any modules that your module loads dynamically here ...
			}
			);
	}
}

I had a similar issue with a different plugin, but I just replaced it. Now I think it’s an issue with how I’m using the new build system and the modules. Here is the doc page on that function so you don’t have to go looking for it: FCollisionResponseContainer::FillArrayFromResponses | Unreal Engine 5.2 Documentation

So the issue is that that function is declared in the EngineTypes.h header, but there’s no definition of it anywhere in the engine, so there’s nothing to link against. It is unusable because it doesn’t exist.

1 Like

Ok. Is there some way to change the linking so that I can use that or is it just dead to me? If it’s verboten then how are we supposed to get the full collision response info from a UPrimativeComponent?
Long story short, I need to get all the collision response data from all of my custom preset actors in a level and then group them by their settings. My plan was to construct a string from the settings and then add them all to a TMap<FString, TArray<AActor*>> basically so that I could group AND reference them in one structure. Thoughts?

Ended up using the EnumArray from that container to the same end, so fair enough! Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.