0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

前提条件

  • C++で記述されたプロジェクト
  • Linuxがオプションで含まれている
    LinuxOption.png

環境

  • Windows 10
  • Visual Studio 2022
  • Unreal Engine 5.x

本編

1. プロジェクトの設定

プロジェクトファイルを右クリックし、 Generate Visual Studio project files を選択します。
GenerateVSP.png

実行後、以下のようにslnファイルが生成されていればOKです。

GeneratedSln.png

2. ビルド設定

生成された プロジェクト名.sln を開き、ビルドを行っていきます。

まずプロジェクト名の ++アイコン を左クリックするとSourceフォルダが表示されます。
そこを更に展開すると.Targetというファイルたちがあります。

image.png

サーバー用のTargetファイルを作成する

  1. 自動的に生成されている プロジェクト名.Target.cs(Editorがついていない方) をコピーする。
    ↓こんな感じのファイルです。バージョンのデータも含まれているので、自分のファイルをコピーしてください。。
using UnrealBuildTool;
using System.Collections.Generic;

public class MyProjectTarget : TargetRules
{
	public MyProjectTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Game;
		DefaultBuildSettings = BuildSettingsVersion.V5;
		IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_4;
		ExtraModuleNames.Add("MyProject");
	}
}
  1. プロジェクト名Server.Target.cs という名前でコピーしたファイルの名前を変える。

また以下のように Type = TargetType.Server; に変更してください。

using UnrealBuildTool;
using System.Collections.Generic;

public class MyProjectServerTarget : TargetRules
{
	public MyProjectServerTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Server;
		DefaultBuildSettings = BuildSettingsVersion.V5;
		IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_4;
		ExtraModuleNames.Add("MyProject");
	}
} 

3. ビルド

画像のようにDevelopment Serverを選択してビルドを行ってください。
ChangeServer.png

ソリューションのビルドを実行してください。
image.png

次にDevelopment Client に変更して再度ビルドを行ってください。
image.png

エディターで以下のように LinuxArm64 を選択して プロジェクト名Server を選択してください。
image.png

画像のように各OSのアイコンが表示されない場合はWindowsの下にある
プラットフォーム状態を更新 を選択してください。

あとはプロジェクトをパッケージ化してビルドを行ってください。

ここでエラーが出た場合はプロジェクト名.slnからDevelopment Editorを選択してビルドを行ってください。
私の場合はこの方法でエラーが解消できました。

参考文献

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?