# Linking error in editor only

**URL:** <https://forums.unrealengine.com/t/linking-error-in-editor-only/1797975>\
**Category:** C++\
**Tags:** linker, unreal-engine, question, CPP\
**Created:** [April 11, 2024, 1:02am UTC](https://forums.unrealengine.com/t/linking-error-in-editor-only/1797975 "2024-04-11T01:02:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IAmNoBody2we](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IAmNoBody2we](https://forums.unrealengine.com/u/IAmNoBody2we)\
**Post date:** [April 11, 2024, 1:02am UTC](https://forums.unrealengine.com/t/linking-error-in-editor-only/1797975/1 "2024-04-11T01:02:58Z")

</div>

My C++ code can be compiled in XCode successfully. And my UE project can be built successfully for release.

But if I click the button in editor for live-coding, it starts to compile and then failed with following error. It seems it cannot find the symbol of `FMetalContext::GetCommandQueue()`

```auto
CompilerResultsLog: [4/6] Compile [Apple] SceneVideoCapture.cpp
CompilerResultsLog: [5/6] Link [Apple] UnrealEditor-MacDemo-5615.dylib
CompilerResultsLog: Undefined symbols for architecture arm64:
CompilerResultsLog: "FMetalContext::GetCommandQueue()", referenced from:
CompilerResultsLog: ASceneVideoCapture::BeginPlay() in SceneVideoCapture.cpp.o
CompilerResultsLog: "FMetalCommandQueue::CommitCommandBuffer(mtlpp::CommandBuffer&)", referenced from:
CompilerResultsLog: ASceneVideoCapture::BeginPlay() in SceneVideoCapture.cpp.o
CompilerResultsLog: ld: symbol(s) not found for architecture arm64
CompilerResultsLog: clang: error: linker command failed with exit code 1 (use -v to see invocation)

```

I have added `MetalRHI` in my `Build.cs`

```csharp
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
        PrivateDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Slate", "RenderCore", "RHI", "RHICore", "Projects" });

        
        if (Target.Platform == UnrealTargetPlatform.Mac)
        {

            PrivateDependencyModuleNames.AddRange(new string[] { "MetalRHI" });
            PublicWeakFrameworks.Add("Metal");
            AddEngineThirdPartyPrivateStaticDependencies(Target, "MTLPP");
            
            string srcPath = Path.Combine( ModuleDirectory, "lib", "libipc.dylib");
            string binariesDir = Path.Combine(GetUProjectPath(), "Binaries", Target.Platform.ToString());
            File.Copy(srcPath, Path.Combine(binariesDir, "libipc.dylib"), true);
            RuntimeDependencies.Add("$(BinaryOutputDir)/libipc.dylib", srcPath);
            
            string libFile = Path.Combine( ModuleDirectory, "lib", "libfrida-gum.a");
            PublicAdditionalLibraries.Add(libFile);
            PublicIncludePaths.AddRange(new string[] { Path.Combine( ModuleDirectory, "lib") });
        }
        else 
        {
            
            string srcPath = Path.Combine( ModuleDirectory, "lib", "ipc.dll");
            string binariesDir = Path.Combine(GetUProjectPath(), "Binaries", Target.Platform.ToString());
            File.Copy(srcPath, Path.Combine(binariesDir, "ipc.dll"), true);
            RuntimeDependencies.Add("$(BinaryOutputDir)/ipc.dll", srcPath);
        }

```

Why it only failed to link in editor model?

Thanks in advance
