背景
unresolved external symbol问题是模块代码使用了其他模块,build.cs文件中没有添加对这些模块的依赖
问题
Error LNK2001 unresolved external symbol "public: virtual void __cdecl UWidget::PreSave(class FObjectPreSaveContext)" (?PreSave@UWidget@@UEAAXVFObjectPreSaveContext@@@Z)
解决
修改.Build.cs文件
PublicDependencyModuleNames.AddRange添加 UMG引用
PublicDependencyModuleNames.AddRange(new string[] { "UMG"});
问题
Error LNK2019 unresolved external symbol "__declspec(dllimport) struct FLogCategoryLogSlate LogSlate" (_imp?LogSlate@@3UFLogCategoryLogSlate@@A)
解决
修改.Build.cs文件
PublicDependencyModuleNames.AddRange添加 UMG引用
PublicDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore"});
标签:unresolved,symbol,AddRange,UMG,external,UE5,PublicDependencyModuleNames
From: https://blog.51cto.com/fengyuzaitu/6948886