> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 簡素化された GDK ディレクトリ構造（ヘッダーとライブラリ）

> GDKCrossPlatform を使って MSBuild、CMake、カスタム ビルド向けに簡素化された October 2025 GDK ディレクトリ レイアウトにオプトインし、x64 タイトルに ARM64 を追加します。

<Note>
  この記事で説明する Microsoft Game Development Kit (GDK) の新しいヘッダーおよびライブラリのレイアウトは、October 2025 GDK でリリースされる予定です。この GDK のプレビュー ビルドに関心がある場合は、Microsoft のアカウント マネージャーにご連絡ください。
</Note>

現行バージョンの Microsoft Game Development Kit (GDK) では、レイアウトはコード共有を中心に最適化され、特定のプラットフォームにフォーカスされていました。このレイアウトのビルド統合は、MSBuild カスタム プラットフォームに複雑さを隠すことに大きく依存していました。新しいレイアウトでは、統合の簡素化、増え続けるターゲット プラットフォームのサポート、および標準の MSBuild プラットフォームと Microsoft 製以外のビルド システム両方のサポート向上に重点が置かれています。

## 旧ヘッダー / ライブラリ レイアウト

Microsoft GDK の既存のファイル レイアウトは、次のようにまとめられます。

```text theme={null}
251000\
    GRDK\
        ExtensionLibraries\
            Xbox.Services.API.C\
                ExtensionLibrary.props
                DesignTime\CommonConfiguration\Neutral\
                    Include\
                    Lib\
                    Redist\
            ...
        GameKit\
            Include\
            Lib\
                amd64\
```

**Gaming.Desktop.x64** カスタム MSBuild プラットフォームは、このコンテンツをさまざまな方法で組み合わせて include/lib パスを構築するロジックを実装しています。CMake やカスタム make ソリューションを使用していた場合、このロジックをそこでも実装する必要がありました。詳細な例については、April 2025 バージョンの [CMakeExample](https://github.com/microsoft/Xbox-GDK-Samples/tree/apr2025/Samples/Tools/CMakeExample) を参照してください。

古いレイアウトは、旧スタイルと新スタイルの両方をサポートするため October 2025 GDK でも引き続き存在しています。新しいレイアウトと古いレイアウトの両方がデフォルトでインストールされます。GDK セットアップには、新しいレイアウトのみをインストールするオプションが追加されました。将来の GDK では、ハード ドライブ フットプリントと全体的なダウンロード サイズを削減するために古いレイアウトが削除されます。古いレイアウトの現在の削除予定日は、October 2025 GDK リリースから 1 年後です。

## 新ヘッダー / ライブラリ レイアウト

October 2025 GDK リリースでは、プラットフォーム統合を容易にし、時間の経過とともに追加のプラットフォームに対応できる、ヘッダーとライブラリの新しい代替レイアウトが提供されます。

```text theme={null}
251000\
    windows\
        bin\
            arm64
            x64\
        include\
        lib\
            arm64
            x64\
        redist
```

## MSBuild カスタム プラットフォームで新レイアウトを使用する

既存の **Gaming.\*.x64** MSBuild プラットフォームはデフォルトで古いレイアウトを使用しますが、**GDKCrossPlatform** プロパティを設定することで新しいレイアウトにオプトインできます。

```xml theme={null}
<PropertyGroup Label="Globals">
...
  <GDKCrossPlatform>true</GDKCrossPlatform>
</PropertyGroup>
```

これにより、古いレイアウトで使用されていた複雑なさまざまなパスの代わりに、適切な include/lib パスがプロジェクトに追加されます。

この新しい簡素化された統合では、extension libraries の仕組みは使用されなくなりました。すべてのコンテンツはビルド時にデフォルトで include/lib パスから利用できます。

プロジェクトは、使用する追加のライブラリにリンクする必要があります。古い GDK プロジェクト テンプレートに基づいて構築されたプロジェクトには、次のような記述が含まれているはずです。

```xml theme={null}
<AdditionalDependencies>uuid.lib;$(Console_Libs);%(XboxExtensionsDependencies);%(AdditionalDependencies)</AdditionalDependencies>
```

新しいレイアウトでは、**Console\_Libs** プロパティがコアの必須ライブラリを列挙します。

| プラットフォーム      | コア ライブラリ                                                     |
| ------------- | ------------------------------------------------------------ |
| Gaming.\*.x64 | xgameruntime.lib d3d12.lib dxguid.lib dxgi.lib gameinput.lib |

プロジェクトは、消費する extension library を **AdditionalDependencies** に追加する必要があります（各ライブラリは「オプトイン」であるためです）。

| プラットフォーム                      | コア ライブラリ                                                                      |
| ----------------------------- | ----------------------------------------------------------------------------- |
| Xbox.LibHttpClient            | libHttpClient.lib                                                             |
| Xbox.XCurl.API                | XCurl.lib                                                                     |
| Xbox.Game.Chat.2.Cpp.API      | GameChat2.lib                                                                 |
| Xbox.Services.API.C (Debug)   | Appnotify.lib winhttp.lib crypt32.lib Microsoft.Xbox.Services.142.C.Debug.lib |
| Xbox.Services.API.C (Release) | Appnotify.lib winhttp.lib crypt32.lib Microsoft.Xbox.Services.142.C.lib       |
| PlayFab.Party.Cpp             | Party.lib                                                                     |
| PlayFab.PartyXboxLive.Cpp     | PartyXboxLive.lib                                                             |
| PlayFab.Services.C            | PlayFabCore.lib PlayFabGameSave.lib PlayFabServices.lib                       |
| PlayFab.Multiplayer.Cpp       | PlayFabMultiplayer.lib                                                        |

プロジェクトは、使用する追加の DLL をレイアウトにコピーする必要もあります。これは、多くの DLL ライブラリ統合で一般的なカスタム ビルド ステップ、または vcxproj の編集や props ファイルの追加で **ReferenceCopyLocalPaths** アイテム グループ リストを使用することで実現できます。以下の MSBuild は考えられるすべての DLL を列挙していますが、個々のプロジェクトはそのうちの一部だけを必要とします。

```xml theme={null}
  <PropertyGroup>
    <GDKCrossPlatformPath Condition="'$(GDKCrossPlatformPath)'==''">$(GameDKCoreLatest)</GDKCrossPlatformPath>
    <GDKCrossPlatformPath Condition="'$(GDKCrossPlatformPath)'==''">$(GameDKXboxLatest)</GDKCrossPlatformPath>
  </PropertyGroup>

  <ItemGroup Condition="'$(Platform)'=='Gaming.Desktop.x64'">
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\libHttpClient.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\XCurl.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\GameChat2.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\Party.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\PartyXboxLive.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\PlayFabCore.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\PlayFabGameSave.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\PlayFabMultiplayer.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\PlayFabServices.dll" />
  </ItemGroup>
```

<Note>
  `GameDKLatest` は、XBOX Extensions 付きの Microsoft GDK でのみ設定されます。そのため、両バージョンの Microsoft GDK のサイドバイサイド インストールを完全にサポートする新しい環境変数が導入されました: `GameDKCoreLatest` は Microsoft GDK によって設定されます。
</Note>

### Directory.Build.props ファイルを使用する

既存の GDK Gaming.\*.x64 プロジェクトを新しいレイアウトで素早く検証する方法として、次の内容を Directory.Build.props という名前のファイルに配置し、ソース ツリーに置いてください。これにより新しいレイアウトにオプトインし、プロジェクトで使用されていない場合でも、ほとんどまたはすべての extension library を含めます。

<Note>
  **GDKExtLibNames** プロパティは、**GDKCrossPlatform** を true に設定してビルドする場合、MSBuild ルールで使用されません。古い MSBuild ルールでビルドするためにすでに存在しているため、この props ファイルではレイアウト内の一部の追加 DLL にオプトインする方法として使用されます。
</Note>

```xml theme={null}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <GDKCrossPlatform>true</GDKCrossPlatform>
    <GDKCrossPlatformPath Condition="'$(GDKCrossPlatformPath)'==''">$(GameDKCoreLatest)</GDKCrossPlatformPath>
    <GDKCrossPlatformPath Condition="'$(GDKCrossPlatformPath)'==''">$(GameDKXboxLatest)</GDKCrossPlatformPath>
    <AllExtensionLibs>Appnotify.lib;winhttp.lib;crypt32.lib;libHttpClient.lib;XCurl.lib;GameChat2.lib;PlayFabCore.lib;PlayFabServices.lib;PlayFabMultiplayer.lib;Party.lib;PartyXboxLive.lib;PlayFabGameSave.lib</AllExtensionLibs>
    <AllExtensionLibs Condition="'$(Configuration)'=='Debug'">Microsoft.Xbox.Services.142.C.Debug.lib;$(AllExtensionLibs)</AllExtensionLibs>
    <AllExtensionLibs Condition="'$(Configuration)'!='Debug'">Microsoft.Xbox.Services.142.C.lib;$(AllExtensionLibs)</AllExtensionLibs>
  </PropertyGroup>

  <ItemDefinitionGroup Condition="'$(Platform)'=='Gaming.Desktop.x64'">
    <Link>
      <AdditionalDependencies>$(AllExtensionLibs);%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>

  <!--
    Makes sure we deploy all the libs we need. We use the 'old layout' GDKExtLibNames property as a way to test
    what is requested to try to reduce the over-inclusion of unused DLLs.
  -->

  <ItemGroup Condition="'$(Platform)'=='Gaming.Desktop.x64'">
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\libHttpClient.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\XCurl.dll" />
  </ItemGroup>

  <ItemGroup Condition="'$(Platform)'=='Gaming.Desktop.x64' AND $(GDKExtLibNames.Contains('Xbox.Game.Chat.2.Cpp.API'))">
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\GameChat2.dll" />
  </ItemGroup>

  <ItemGroup Condition="'$(Platform)'=='Gaming.Desktop.x64' AND $(GDKExtLibNames.Contains('PlayFab'))">
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\Party.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\PartyXboxLive.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\PlayFabCore.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\PlayFabGameSave.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\PlayFabMultiplayer.dll" />
    <ReferenceCopyLocalPaths Include="$(GDKCrossPlatformPath)windows\bin\x64\PlayFabServices.dll" />
  </ItemGroup>

</Project>
```

## x64 ゲームを ARM64 対応に更新する方法

既存の x64 ゲーム プロジェクトに ARM64 サポートを追加するには、次の手順に従ってください。

1. **Visual Studio 2022 を使用します。** ARM64 サポートには Visual Studio 2022 が必要です。Visual Studio 2019 は ARM64 ビルドではサポートされません。
2. **新しいレイアウトを有効化します。** プロジェクト ファイルで `GDKCrossPlatform` を `true` に設定し、プロジェクトが新しいレイアウトを使用するようにします。
3. **ARM64 構成を作成します。** 既存の x64 構成（Debug、Release など）をコピーして、対応する ARM64 構成を作成します。
4. **ライブラリ パスを更新します。** ARM64 構成の VC++ Directories を編集し、ライブラリ パスが `lib\x64` ではなく `lib\arm64` を参照するようにします。
5. **XSAPI ライブラリ参照を更新します。** *すべての* 構成（ARM64 だけでなく）のリンク ステートメントを更新して、`Microsoft.Xbox.Services.142.GDK.C.lib` の代わりに `Microsoft.Xbox.Services.143.GDK.C.lib` を使用するようにします。
6. **ReferenceCopyLocalPaths を更新します。** `.vcxproj` ファイル内の `ReferenceCopyLocalPaths` の使用を確認し、`x64` の代わりに `arm64` bin フォルダーを参照するように更新が必要ないかチェックします。

<Note>
  タイトルの起動が 0xc000007b エラーで失敗した場合、誤って x64 形式の DLL を ARM64 プロセスに読み込もうとしていることを意味します。更新が必要な `ReferenceCopyLocalPaths` アイテムがないか、プロジェクト システムを確認してください。
</Note>

## MSBuild x64 プラットフォームで新レイアウトを使用する

**Gaming.Desktop.x64** プラットフォームの代わりに、標準の **x64** プラットフォームを使用して PC 向けにビルドできます。古いレイアウトでは、Using the x64 platform with the Microsoft Game Development Kit (GDK) で詳しく説明されているとおり、Extension Libraries 用に `<Import Project="...\ExtensionLibrary.props">` ステートメントを追加する必要がありました。

新しいレイアウトでは、統合手順が簡素化されています。

```xml theme={null}
  <PropertyGroup>
    <GDKCrossPlatformPath Condition="'$(GDKCrossPlatformPath)'==''">$(GameDKCoreLatest)</GDKCrossPlatformPath>
    <GDKCrossPlatformPath Condition="'$(GDKCrossPlatformPath)'==''">$(GameDKXboxLatest)</GDKCrossPlatformPath>
  </PropertyGroup>
```

```xml theme={null}
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
  <ExecutablePath>$(GameDK)bin;$(GDKCrossPlatformPath)windows\bin\x64;$(ExecutablePath)</ExecutablePath>
  <IncludePath>$(GDKCrossPlatformPath)windows\Include;$(IncludePath);</IncludePath>
  <LibraryPath>$(GDKCrossPlatformPath)windows\lib\x64;$(LibraryPath)</LibraryPath>
</PropertyGroup>
```

```xml theme={null}
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
  <ExecutablePath>$(GameDK)bin;$(GDKCrossPlatformPath)windows\bin\x64;$(ExecutablePath)</ExecutablePath>
  <IncludePath>$(GDKCrossPlatformPath)windows\Include;$(IncludePath);</IncludePath>
  <LibraryPath>$(GDKCrossPlatformPath)windows\lib\x64;$(LibraryPath)</LibraryPath>
</PropertyGroup>
```

必要なすべての extension library を、元のリストとともに **AdditionalDependencies** に追加します。

```xml theme={null}
<AdditionalDependencies>xgameruntime.lib;gameinput.lib;d3d12.lib;dxgi.lib;dxguid.lib;uuid.lib;kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
```

オプトインの extension library DLL は、上述のカスタム ビルド アクションを使用するか、最終レイアウト用に **ReferenceCopyLocalPaths** アイテム グループを使用して、バイナリ ディレクトリにコピーする必要があります。

**PreprocessorDefinitions** と、イメージ アセット付きの .mgc ファイルを扱う残りの手順は変わりません。

## CMake で新レイアウトを使用する

Microsoft Visual Studio ジェネレーターを CMake とともに使用し、**Gaming.\*.x64** カスタム MSBuild プラットフォームを使用する場合は、次のコードを使って新しいレイアウトを有効化してください。

```text theme={null}
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_GLOBAL_GDKCrossPlatform "true")
```

[CMakeGDKExample](https://github.com/microsoft/Xbox-GDK-Samples/tree/apr2025/Samples/Tools/CMakeGDKExample) では、`VS_GLOBAL_GDKExtLibNames` の使用を削除し、（CMake 3.21 以降を前提として）次のコードに置き換えて、使用する extension DLL をレイアウトにコピーしてください。

```text theme={null}
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E $<IF:$<BOOL:$<TARGET_RUNTIME_DLLS:${PROJECT_NAME}>>,copy,true>
    $<TARGET_RUNTIME_DLLS:${PROJECT_NAME}> $<TARGET_FILE_DIR:${PROJECT_NAME}>
    COMMAND_EXPAND_LISTS
    )
```

## カスタム ビルド システムで新レイアウトを使用する

GDK を使用して Windows x64 向けにビルドするには、次を実行します。

```cmd theme={null}
set INCLUDE=%GameDKCoreLatest%windows\include;%INCLUDE%
set LIB=%GameDKCoreLatest%windows\lib\x64;%LIB%
set PATH=%GameDK%bin;%GameDKCoreLatest%windows\bin\x64;%PATH%
```

## インストール済みファイルからビルド エディションを読み取る

新しいレイアウトには `grdk.ini` ファイルは含まれていません。ファイルを解析してエディション情報を取得するには、`grdk.h` を使用してください。

以下は、古い GDK リリースでも機能する PowerShell の例です。

```powershell theme={null}
$result = Get-ChildItem -Path $env:GameDKCoreLatest -Filter "grdk.h" -Recurse
if ($result.Count -eq 0)
{
    $result = Get-ChildItem -Path $env:GRDKLatest -Filter "grdk.h" -Recurse
}
if ($result.Count -eq 0)
{
    Write-Error "##[error]Failed to find grdk.h in either GameDKCoreLatest or GRDKLatest" -ErrorAction Stop
}

$content = Get-Content -Path $result[0].FullName

if (-not ([string]$content -match '#define\s+_GRDK_EDITION\s+([0-9][0-9][0-9][0-9][0-9][0-9])')) {
    Write-Error "##[error]Failed to find edition define" -ErrorAction Stop
}

$xbld_edition = $Matches[1]

if (-not ([string]$content -match '#define\s+_GRDKVER_PRODUCTBUILDVER_FULL\s+([0-9]+\.[0-9]+\.([0-9]+)\.[0-9]+)')) {
    Write-Error "##[error]Failed to find full version define" -ErrorAction Stop
}

$xbld_full_productbuild = $Matches[1]
$xbld_build = $Matches[2]

if (-not ([string]$content -match '#define\s+_GRDK_MM_NUM\s+([0-9]{1,2})')) {
    Write-Error "##[error]Failed to find month define" -ErrorAction Stop
}

$month = $Matches[1]

if (-not ([string]$content -match '#define\s+_GRDK_FULLYY\s+([0-9]{4})')) {
    Write-Error "##[error]Failed to find full year define" -ErrorAction Stop
}

$year = $Matches[1]

Write-Output ("_xbld_name={0} {1} GRDK" -f (Get-Culture).DateTimeFormat.GetMonthName([int]$month), $year)
Write-Output ("_xbld_edition={0}" -f $xbld_edition)
Write-Output ("_xbld_full_productbuild={0}" -f $xbld_full_productbuild)
Write-Output ("_xbld_build={0}" -f $xbld_build)
```


## Related topics

- [Linux getting started](/ja-jp/services/playfab/multiplayer/networking/linux-specific-requirements.md)
- [NDA トピック ディレクトリ - Microsoft Learn 公開版へのリンク](/ja-jp/nda/nda-topic-directory.md)
- [PlayFab Unified SDK クイックスタートセットアップ](/ja-jp/services/playfab/sdks/unified-sdk/quickstart-setup.md)
- [PlayFab スタンドアロン SDK v1 から統合 SDK v2 への移行](/ja-jp/services/playfab/sdks/unified-sdk/migrating-from-v1.md)
- [PlayFab GDPR - プレイヤー データのエクスポート](/ja-jp/services/playfab/data-analytics/privacy-compliance/gdpr-exporting-player-data.md)
