Unreal Thirdparty 标志

Unreal Thirdparty

社区
maystudios
unreal-thirdparty

将第三方 C/C++ 库集成到 Unreal Engine 5.x 项目和插件中的专家指南。涵盖静态链接、动态链接(DLL/SO/dylib)、Build.cs 配置、ModuleType.External、延迟加载、运行时依赖项暂存、封装模式、跨平台注意事项(Windows/macOS/Linux)、ABI 兼容性、RTTI/异常、使用 THIRD_PARTY_INCLUDES_START/END 包含头文件,以及常见问题。适用于用户咨询添加外部库或第三方代码、链接 .lib/.a/.dll/.so/.dylib 文件、Build.cs PublicAdditionalLibraries、PublicDelayLoadDLLs、RuntimeDependencies、ModuleType.External、为 UE 封装 C++ 库、FPlatformProcess::GetDllHandle、为 UE 在 Linux 上交叉编译库,或排查第三方代码的链接器错误/DLL 加载失败等问题。

Add to TypingMind

概览

发布者maystudios
代码仓库claude-skills
技能名称unreal-thirdparty
星标数
30
复刻数
3
附带文件
4
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 4 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 maystudios 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Unreal Thirdparty AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/maystudios/claude-skills/tree/main/unreal-thirdparty
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maystudios/claude-skills.git /tmp/claude-skills
mkdir -p .claude/skills
cp -r /tmp/claude-skills/unreal-thirdparty .claude/skills/unreal-thirdparty
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Unreal Thirdparty,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Unreal Thirdparty。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Unreal Thirdparty 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Unreal Engine Third-Party Library Integration -- C++ Guide

Official Documentation (always consult for latest details)

Additional Community Resources

SourceURL
UE Community Wiki: Custom ThirdParty from Scratchhttps://unrealcommunity.wiki/adding-custom-third-party-library-to-plugin-from-scratch-867b28
Yulong He: DLL Plugin + Packaging (Medium)https://yulonghe.medium.com/ue5-how-to-create-a-plugin-that-works-with-dlls-packaging-and-external-files-11f8ff9d7491
Marieke van Neutigem: Updating Plugin for UE5https://mariekevanneutigem.nl/blog/pV20/updating-a-plugin-with-third-party-library-for-ue5
Adam Rehn: Cross-Platform + Conanhttps://adamrehn.com/articles/cross-platform-library-integration-in-unreal-engine-4/
Parallelcube: Mobile/Desktop ThirdPartyhttps://www.parallelcube.com/2018/03/01/using-thirdparty-libraries-in-our-ue4-mobile-project/
AGX Dynamics: Barrier Module Patternhttps://us.download.algoryx.se/AGXUnreal/documentation/current/agx-api-access.html
GitHub: UE4CMake (CMake integration)https://github.com/caseymcc/UE4CMake
GitHub: CMakeUnrealhttps://github.com/kaustubh138/CMakeUnreal
GitHub: UnrealMacroNukehttps://github.com/hiili/UnrealMacroNuke
GitHub: UnrealNlohmannJsonhttps://github.com/dclipca/UnrealNlohmannJson
GitHub: shadowmint/ue4-static-pluginhttps://github.com/shadowmint/ue4-static-plugin
GitHub: iFunFactory Funapi (multi-platform)https://github.com/iFunFactory/engine-plugin-ue4
Satisfactory Modding: ThirdPartyhttps://docs.ficsit.app/satisfactory-modding/latest/Development/Cpp/thirdparty.html
slowburn.dev: UE Upgrades (Build.cs changes)https://slowburn.dev/dataconfig/Advanced/UEUpgrades.html
alain.xyz: Working with 3rd Party Librarieshttps://alain.xyz/blog/ue4-working-with-3rd-party-libraries
dawnarc.com: Build.cs Noteshttps://dawnarc.com/2019/01/ue4build.cs-notes/
ikrima.dev: Build File Demystifiedhttps://ikrima.dev/ue4guide/archived_content/unreal-engine-4-build-file-demystified-dmitry-yanovsky/
ikrima.dev: Linking External DLLshttps://ikrima.dev/ue4guide/build-guide/plugins-modules/linking-external-dlls-or-libraries/
gg-labs: Linking DLLshttps://unreal.gg-labs.com/wiki-archives/devops/linking-dlls
conan-ue4cli docshttps://docs.adamrehn.com/conan-ue4cli/read-these-first/introduction-to-conan-ue4cli

Plugin Template

UE ships a Third Party Library plugin template. In the editor: Plugins > New Plugin > Third Party Library (scroll to bottom). This generates the scaffolding for a DLL-based integration. For static libraries, the two-line approach in Build.cs is simpler.

Core Architecture

See references/build-system.md for the full Build.cs reference with all properties and path variables.

Integration flow:

Third-Party Source (or prebuilt binaries)
  |
  v
[Optional: Recompile with UE toolchain for ABI compat]
  |
  v
Place headers + libs in Plugin/Source/ThirdParty/
  |
  v
Create External Module (.Build.cs with ModuleType.External)
  |-- PublicIncludePaths        -> header directories
  |-- PublicAdditionalLibraries -> .lib / .a files
  |-- PublicDelayLoadDLLs       -> DLL names (Windows delay-load)
  |-- RuntimeDependencies       -> .dll / .so / .dylib staging
  |-- PublicDefinitions         -> preprocessor macros
  v
Consumer Module depends on External Module
  |-- PublicDependencyModuleNames.Add("MyThirdPartyLib")
  |-- #include with THIRD_PARTY_INCLUDES_START/END
  v
Use library API in UE C++ code

Recommended directory layout:

MyPlugin/
  MyPlugin.uplugin
  Source/
    MyPlugin/                        # Runtime module (your code)
      MyPlugin.Build.cs
      Private/
      Public/
    ThirdParty/
      MyLibrary/                     # External module (no source)
        MyLibrary.Build.cs           # Type = ModuleType.External
        include/                     # Library headers
        lib/
          Win64/  *.lib
          Linux/  *.a or *.so
          Mac/    *.a or *.dylib
  Binaries/
    ThirdParty/MyLibrary/Win64/      # DLLs (if dynamic linking)

Four Integration Approaches

See references/linking-patterns.md for detailed code examples of each approach.

ApproachWhen to UseBuild.cs Properties
Static librarySimplest; single executable; no DLL distributionPublicAdditionalLibraries
Dynamic + import libDLL with compile-time symbol resolutionPublicAdditionalLibraries + PublicDelayLoadDLLs + RuntimeDependencies
Dynamic, no import libRuntime function pointer lookup via GetDllExportRuntimeDependencies only
Multi-platform staticCross-platform plugin with per-platform libsPublicAdditionalLibraries with Target.Platform switch

Library File Types

PlatformStaticDynamicImport LibPrefix
Windows.lib.dll.libnone
Linux / Android.a.son/alib
macOS / iOS.a.dylibn/alib

Build.cs Quick Reference

PropertyPurpose
Type = ModuleType.ExternalModule wraps prebuilt libs, no UE source compilation
PublicIncludePathsHeader search directories
PublicSystemIncludePathsSame but suppresses warnings from these headers
PublicAdditionalLibrariesStatic / import library file paths
PublicDelayLoadDLLsDLL filenames for Windows delay-loading
RuntimeDependenciesFiles to stage alongside executable for packaging
PublicDefinitionsPreprocessor defines ("WITH_MYLIB=1")
PublicFrameworksmacOS frameworks
bUseRTTIEnable RTTI (required by Boost, some C++ libs)
bEnableExceptionsEnable C++ exceptions (required by many libs)
bForceEnableRTTIForce RTTI engine-wide (in TargetRules)

Platform-Specific Considerations

See references/platform-specifics.md for Windows DLL loading, macOS @rpath/dylib, and Linux ABI/sysroot details.

Key rules:

  • Windows: DLLs found by name only (no path in import table). Use FPlatformProcess::GetDllHandle() or delay-loading. UE searches Engine/Project/Plugin Binaries/Win64/ directories.
  • macOS: Dylibs use @rpath install names. Set with install_name_tool -id @rpath/libfoo.dylib. UBT auto-adds RPATH entries.
  • Linux: Must recompile C++ libs with UE's Clang + libc++ (not system libstdc++). C libs (stable ABI) don't need recompilation. Use UE's CMake toolchain file.

Common Patterns & Pitfalls

See references/patterns-and-pitfalls.md for implementation recipes, critical pitfalls, and troubleshooting.

Critical pitfalls:

  • UE's check macro collides with third-party code using check as an identifier -- #undef check or wrap includes
  • Compile with /MD (Multi-threaded DLL) to match UE's runtime -- mismatched CRT causes linker errors
  • RTTI + Exceptions off by default -- Boost, PCL, and many C++ libs require bUseRTTI = true and bEnableExceptions = true in BOTH the External module AND every consuming module
  • Release libs only -- UE uses Release CRT; Debug-built libs cause _ITERATOR_DEBUG_LEVEL mismatch and access violations
  • VS project settings are ignored -- only .Build.cs matters; Visual Studio properties have zero effect on UBT
  • Binaries/ThirdParty/ is NOT regenerated -- if deleted, the template's DLLs are gone; cannot be rebuilt by UBT
  • Linux ABI mismatch -- C++ libs compiled with libstdc++ produce different symbol mangling than UE's libc++

UE Version-Specific Build.cs Changes

See references/build-system.md for the complete version-by-version changelog.

Key breaking changes affecting third-party integration:

  • UE 5.0: FVector changed to 3 doubles; TObjectPtr replaces raw UObject pointers
  • UE 5.2: bEnforceIWYU (bool) changed to IWYUSupport (enum)
  • UE 5.3: BuildSettingsVersion.V4 defaults to C++20; TRemoveConst deprecated for std::remove_const
  • UE 5.4: Default MSVC warning level changed to /W4; FText internals changed from TSharedRef to TRefCountPtr
  • UE 5.5: New Engine/Build/BatchFiles/RunUBT scripts replace direct UBT invocation; PER_MODULE_BOILERPLATE no longer required; StructUtils plugin deprecated (moved to engine)
  • UE 5.6: FString::Appendf enforces static constexpr format strings; GMalloc access deprecated
  • UE 5.7: FindObject deprecates bExactClass in favor of EFindObjectFlags

Advanced Patterns

Barrier Modules (isolating incompatible compiler settings)

When a third-party library requires bUseRTTI = true and bEnableExceptions = true but you want to minimize the blast radius, create a barrier module that isolates the library behind a clean interface:

Plugin/
  Source/
    ThirdParty/MyLib/          # ModuleType.External (headers + libs)
    MyLibBarrier/              # Barrier module (bUseRTTI=true, bEnableExceptions=true)
      Public/  -> clean types only, no third-party headers, no UObject.h
      Private/ -> wraps third-party includes with BeginIncludes/EndIncludes
    MyPlugin/                  # Main module, depends on MyLibBarrier (NOT on MyLib directly)

Public headers of barrier modules must NOT include third-party headers or trigger UObject.h inclusion. All third-party types are passed as opaque barrier types. See the AGX Dynamics documentation for a production example.

CMake Integration via UE4CMake

The UE4CMake plugin provides CMakeTarget.add() in Build.cs to build CMake libraries as part of UBT:

csharp
CMakeTarget.add(Target, this, "TargetName",
    Path.Combine(ModuleDirectory, "../Libs/Source"),
    "-DCUSTOM_OPTION=ON", false);

It automatically populates PublicIncludePaths and PublicAdditionalLibraries from CMake output, registers source files in ExternalDependencies for change detection, and handles struct packing via PRAGMA_PUSH_PLATFORM_DEFAULT_PACKING / PRAGMA_POP_PLATFORM_DEFAULT_PACKING.

UnrealMacroNuke (comprehensive macro decontamination)

For libraries that conflict with many UE macros beyond just check, UnrealMacroNuke generates paired headers that undefine and redefine all conflicting macros:

cpp
#pragma warning(push)
#pragma warning(disable: <codes>)
#include "UndefineMacros_UE_5.3.h"
#include "third_party/library.hpp"
#include "RedefineMacros_UE_5.3.h"
#pragma warning(pop)

Conan Package Manager Integration

The conan-ue4cli package automates third-party library builds against UE's bundled dependencies. Build.cs spawns conan install and parses conanbuildinfo.json to extract include paths, library paths, and definitions. Critical for solving symbol interposition when both UE and a third-party library depend on different versions of the same library (e.g., zlib, libpng).

Android APL (Android Packaging Layer)

Android third-party libraries require APL XML files for native library deployment and Java integration:

csharp
// Build.cs -- Android
AdditionalPropertiesForReceipt.Add("AndroidPlugin",
    Utils.MakePathRelativeTo(
        Path.Combine(ThirdPartyPath, "LIBRARY_APL.xml"),
        Target.RelativeEnginePath));

ExternalDependencies for Change Detection

Register external files that should trigger rebuilds when modified:

csharp
ExternalDependencies.Add(Path.Combine(ModuleDirectory, "include", "version.h"));

This ensures UBT regenerates the makefile if the specified files change, useful for tracking header or library binary updates.

AddEngineThirdPartyPrivateStaticDependencies

Use engine-bundled libraries without maintaining your own copies:

csharp
AddEngineThirdPartyPrivateStaticDependencies(Target, "OpenSSL", "libWebSockets", "libcurl", "zlib");

This is the preferred way to consume libraries already shipped with the engine.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Unreal Thirdparty AI 技能有什么作用?

将第三方 C/C++ 库集成到 Unreal Engine 5.x 项目和插件中的专家指南。涵盖静态链接、动态链接(DLL/SO/dylib)、Build.cs 配置、ModuleType.External、延迟加载、运行时依赖项暂存、封装模式、跨平台注意事项(Windows/macOS/Linux)、ABI 兼容性、RTTI/异常、使用 THIRD_PARTY_INCLUDES_START/END 包含头文件,以及常见问题。适用于用户咨询添加外部库或第三方代码、链接 .lib/.a/.dll/.so/.dylib 文件、Build.cs PublicAdditionalLibraries、PublicDelayLoadDLLs、RuntimeDependencies、ModuleType.External、为 UE 封装 C++ 库、FPlatformProcess::GetDllHandle、为 UE 在 Linux 上交叉编译库,或排查第三方代码的链接器错误/DLL 加载失败等问题。

为什么在 TypingMind 中使用 Unreal Thirdparty?

因为您只需安装一次,就能搭配任何模型使用。Unreal Thirdparty 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Unreal Thirdparty?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/maystudios/claude-skills/tree/main/unreal-thirdparty。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Unreal Thirdparty?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Unreal Thirdparty 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Unreal Thirdparty 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Unreal Thirdparty AI 技能免费吗?

是的。maystudios 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇