# Adding C++ class failed in Xcode

**URL:** <https://forums.unrealengine.com/t/adding-c-class-failed-in-xcode/2673123>\
**Category:** Platform & Builds\
**Tags:** osx, MAC, unreal-engine, CPP, question\
**Created:** [November 9, 2025, 4:16am UTC](https://forums.unrealengine.com/t/adding-c-class-failed-in-xcode/2673123 "2025-11-09T04:16:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tontoro19](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tontoro19](https://forums.unrealengine.com/u/tontoro19)\
**Post date:** [November 9, 2025, 4:16am UTC](https://forums.unrealengine.com/t/adding-c-class-failed-in-xcode/2673123/1 "2025-11-09T04:16:51Z")

</div>

I want to add a UBlueprintFunctionLibrary based class but got link error .Is there a way to solve this?

the code i added is

```cpp
# header
#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "LandscapeReadyChecker.generated.h"

UCLASS()
class ADDCPP_API ULandscapeReadyChecker : public UBlueprintFunctionLibrary
{
    GENERATED_BODY()
public:
    UFUNCTION(BlueprintCallable, Category="Landscape")
    static bool IsLandscapeReady();
};

# source
#include "LandscapeReadyChecker.h"
#include "ShaderPipelineCache.h"
bool ULandscapeReadyChecker::IsLandscapeReady()
{
    return FShaderPipelineCache::NumPrecompilesRemaining() == 0;
}

```

The project compiles successfully for the **ProjectName** target (addCpp), but results in a **linker error** when compiling for the **ProjectName** +Editor target (add Editor).

Below is the error message

```plaintext
[1/2] Link [Apple] UnrealEditor-addCpp.dylib (UBA disabled)
Undefined symbols for architecture arm64:
  "FShaderPipelineCache::NumPrecompilesRemaining()", referenced from:
      ULandscapeReadyChecker::IsLandscapeReady() in LandscapeReadyChecker.cpp.o

```

If I remove ULandscapeReadyChecker class, the project compiles successfully in both target. I’m using UnrealEngine 5.5, Xcode 16, M1 Mac.

Thanks

---

<div class="post-metadata">

**Author:** ![tontoro19](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tontoro19](https://forums.unrealengine.com/u/tontoro19)\
**Post date:** [November 9, 2025, 12:46pm UTC](https://forums.unrealengine.com/t/adding-c-class-failed-in-xcode/2673123/2 "2025-11-09T12:46:24Z")

</div>

I need to add modules to use ShaderPipelineCache in Editor mode

Adding this code to .build.cs resolved the issue

```csharp
if (Target.bBuildEditor)
{
    PrivateDependencyModuleNames.AddRange(new string[] {
        "RenderCore",
        "RHI"
    });
    PrivateDependencyModuleNames.Add("UnrealEd");
}

```
