首页 > 解决方案 > Mac 上的 UE4 4.26:未定义符号 Z_Construct_UClass_UPhysicalMaterial

问题描述

试图让我的项目在 macos big sur 上启动并运行,但我遇到了链接错误(此处完整粘贴:https ://pastebin.com/raw/qt7qkjYu ):

[10/13] Link UE4Editor-LastRenegade.dylib
Undefined symbols for architecture x86_64:
  "Z_Construct_UClass_UPhysicalMaterial()", referenced from:
      Z_Construct_UClass_ULRNBasePhysicalMaterial_Statics::DependentSingletons in LRNBasePhysicalMaterial.gen.cpp.o
  "UPhysicalMaterial::GetPrivateStaticClass()", referenced from:

[...]

ld: symbol(s) not found for architecture x86_64

我正在覆盖物理材质以从光线投射中获取有用的信息:

UCLASS()
class LASTRENEGADE_API ULRNBasePhysicalMaterial : public UPhysicalMaterial
{
    GENERATED_BODY()

public:
    ULRNBasePhysicalMaterial(); (defined in a cpp file)

public:
    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    class USoundBase* ImpactSFX;
    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    class UParticleSystem* ImpactVFX;
    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    class UMaterialInterface* ImpactDecal;
};

标签: c++linkerunreal-engine4

解决方案


好的,在 4.26 中:你需要添加PhysicsCore到你的 MyGame.Build.cs


推荐阅读