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