Overview:
To implement browser functionality within the UE5.4 game, I attempted to include the third-party library CEF (Chromium Embedded Framework) and build the project. However, the build failed with the following error:
ld: framework 'cef' not found
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Goal:
To resolve the above error and successfully complete the build.
Environment Information:
Directory Structure:
MyProject/
└── Plugins/
└── MyPlugin/
└── Sorce/
├── BuildOutput
├── Config
├── Content
├── Resources
├── Source/
│ └── MyPlugin/
│ ├── Private/
│ │ ├── MyPlugin.cpp
│ │ └── MyPluginBPLibrary.cpp
│ ├── Public/
│ │ └── MyPlugin.h
│ ├── ThirdParty/
│ │ └── CEF/
│ │ ├── Mac/
│ │ │ └── cef.framework //Chromium Embedded Framework.framework/
│ │ │ ├── cef //ChromiumEmbeddedFramework
│ │ │ ├── Libraries
│ │ │ ├── Resources
│ │ │ └── ChromiumEmbeddedFramework.framework // [Chromium Embedded Framework.framework]のシンボリックリンク
│ │ └── include/
│ │ └── *.h //headerFiles
│ └── MyPlugin.Build.cs
└── TestCEF.uplugin
Buid.cs
using UnrealBuildTool;
using System;
using System.IO;
public class TestCEF : ModuleRules
{
public TestCEF(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
Console.WriteLine("[Debug][Info]Starting Compile");
// モジュールのパスを取得
string ModulePath = ModuleDirectory;
string ThirdPartyPath = Path.Combine(ModulePath, "ThirdParty", "CEF");
Console.WriteLine("[Debug][set Param]ThirdPartyPath:"+ThirdPartyPath);
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "Slate", "SlateCore", "Projects" });
PublicIncludePaths.Add(ThirdPartyPath);
PublicFrameworks.AddRange(new string[] {
"AppKit",
"WebKit",
"Cocoa",
"Carbon",
"IOKit",
"Security",
"UniformTypeIdentifiers",
"AVFoundation",
"CoreVideo",
"CoreMedia"
});
// CEF フレームワークの追加
if (Target.Platform == UnrealTargetPlatform.Mac)
{
string CEFFrameworkName = "cef";
string CEFFrameworkPath = Path.Combine(ThirdPartyPath, "Mac", "cef.framework", "cef");
Console.WriteLine("[Debug][set Param]CEFFrameworkPath:"+CEFFrameworkPath);
PublicSystemLibraryPaths.Add(Path.Combine(ThirdPartyPath, "Mac", "cef.framework"));
PublicAdditionalFrameworks.Add(new Framework(
CEFFrameworkName,
CEFFrameworkPath,
"cef" // フレームワーク内のバイナリ名を指定
));
}
}
}
Plugin State Verification:
%otool -L "/Volumes/SSD_Intel/Game/CretatePlugins/Plugins/TestCEF/Source/TestCEF/ThirdParty/CEF/Mac/cef.framework/cef"
/Volumes/SSD_Intel/Game/CretatePlugins/Plugins/TestCEF/Source/TestCEF/ThirdParty/CEF/Mac/cef.framework/cef:
@rpath/cef.framework/cef (compatibility version 1284.0.12, current version 1284.0.12)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 2048.1.255)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 2048.1.255)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1774.0.4)
/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 61040.1.3)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 64.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1226.0.0)
/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork (compatibility version 1.0.0, current version 1474.0.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2483.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/LocalAuthentication.framework/Versions/A/LocalAuthentication (compatibility version 1.0.0, current version 1391.0.4)
/System/Library/Frameworks/CryptoTokenKit.framework/Versions/A/CryptoTokenKit (compatibility version 0.0.0, current version 685.0.10)
/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 1296.0.1)
/System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers (compatibility version 1.0.0, current version 709.0.0, weak)
/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 1.5.0)
/System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AVFoundation.framework/Versions/A/AVFoundation (compatibility version 1.0.0, current version 2.0.0)
/System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
/System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage (compatibility version 1.0.1, current version 6.0.0)
/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Quartz.framework/Versions/A/Quartz (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 341.16.0, weak)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 24.0.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 170.0.0)
/System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AuthenticationServices.framework/Versions/A/AuthenticationServices (compatibility version 1.0.0, current version 616.1.27)
/System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI (compatibility version 1.0.0, current version 69.0.0)
/System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility (compatibility version 1.0.0, current version 62.0.0)
/System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface (compatibility version 1.0.0, current version 55180.0.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/ImageCaptureCore.framework/Versions/A/ImageCaptureCore (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/SafariServices.framework/Versions/A/SafariServices (compatibility version 535.0.0, current version 616.1.27)
/System/Library/Frameworks/UserNotifications.framework/Versions/A/UserNotifications (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/GameController.framework/Versions/A/GameController (compatibility version 1.0.0, current version 11.0.24)
/System/Library/Frameworks/ForceFeedback.framework/Versions/A/ForceFeedback (compatibility version 1.0.0, current version 1.0.2)
/System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/CoreLocation.framework/Versions/A/CoreLocation (compatibility version 1.0.0, current version 2886.3.3)
/System/Library/Frameworks/Vision.framework/Versions/A/Vision (compatibility version 1.0.0, current version 7.0.45)
/System/Library/Frameworks/CoreML.framework/Versions/A/CoreML (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement (compatibility version 1.0.0, current version 2679.0.25)
/System/Library/Frameworks/ScreenCaptureKit.framework/Versions/A/ScreenCaptureKit (compatibility version 1.0.0, current version 1.0.0, weak)
/System/Library/Frameworks/Accessibility.framework/Versions/A/Accessibility (compatibility version 1.0.0, current version 1.0.0, weak)
/System/Library/Frameworks/MetalKit.framework/Versions/A/MetalKit (compatibility version 1.0.0, current version 159.0.0, weak)
/System/Library/Frameworks/MediaPlayer.framework/Versions/A/MediaPlayer (compatibility version 1.0.0, current version 1.0.0, weak)
/System/Library/Frameworks/LocalAuthenticationEmbeddedUI.framework/Versions/A/LocalAuthenticationEmbeddedUI (compatibility version 1.0.0, current version 1391.0.4, weak)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.0.0)
/usr/lib/libcups.2.dylib (compatibility version 2.0.0, current version 2.14.0)
/usr/lib/libbsm.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libpmenergy.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libpmsample.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libsandbox.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.8)
Build Command:
/Volumes/SSD_Intel/UE_5.4/Engine/Build/BatchFiles/RunUAT.sh BuildPlugin -Plugin="/Volumes/SSD_Intel/Game/CretatePlugins/Plugins/TestCEF/TestCEF.uplugin" -Package="/Volumes/SSD_Intel/Game/CretatePlugins/Plugins/TestCEF/BuildOutput" -TargetPlatforms=Mac -VeryVerbose -FrameworkPath="/Volumes/SSD_Intel/Game/CretatePlugins/Plugins/TestCEF/ThirdParty/CEF/Mac"