Agones: UE4 plugin fails to compile with default UE4 4.24 project

Created on 5 Feb 2020  ·  4Comments  ·  Source: googleforgames/agones

What happened:

UE4 plugin compilation failed.

What you expected to happen:

UE4 plugin compilation should succeed.

How to reproduce it (as minimally and precisely as possible):

  1. Create a new, blank UE4 C++ project with UE4 4.24.
  2. Copy Agones plugin to Plugins directory.
  3. Build

Results in compilation failure:

------ Build started: Project: AgonesTest, Configuration: Development_Editor x64 ------
Using 'git status' to determine working set for adaptive non-unity build (E:\UE4PrivateExamples).
Invalidating makefile for AgonesTestEditor (AgonesTestEditor.Target.cs modified)
Parsing headers for AgonesTestEditor
  Running UnrealHeaderTool "E:\UE4PrivateExamples\AgonesTest\AgonesTest.uproject" "E:\UE4PrivateExamples\AgonesTest\Intermediate\Build\Win64\AgonesTestEditor\Development\AgonesTestEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Reflection code generated for AgonesTestEditor in 5.8996207 seconds
Building AgonesTestEditor...
Using Visual Studio 2019 14.24.28315 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314) and Windows 10.0.16299.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 11 actions with 8 processes...
  [1/11] Module.Agones.cpp
E:\UE4PrivateExamples\AgonesTest\Plugins\Agones\Source\Agones\Public\Agones.h(18): fatal error C1083: Cannot open include file: 'ModuleManager.h': No such file or directory
  [2/11] Module.Agones.gen.cpp
E:\UE4PrivateExamples\AgonesTest\Plugins\Agones\Source\Agones\Model\GameServerObjectMeta.h(18): fatal error C1083: Cannot open include file: 'JsonObject.h': No such file or directory
  [3/11] AgonesTest.cpp
  [4/11] AgonesTest.init.gen.cpp
  [5/11] AgonesTestGameModeBase.cpp
  [6/11] AgonesTestGameModeBase.gen.cpp
  [7/11] UE4Editor-AgonesTest.lib
     Creating library E:\UE4PrivateExamples\AgonesTest\Intermediate\Build\Win64\UE4Editor\Development\AgonesTest\UE4Editor-AgonesTest.lib and object E:\UE4PrivateExamples\AgonesTest\Intermediate\Build\Win64\UE4Editor\Development\AgonesTest\UE4Editor-AgonesTest.exp
  [8/11] UE4Editor-AgonesTest.dll
     Creating library E:\UE4PrivateExamples\AgonesTest\Intermediate\Build\Win64\UE4Editor\Development\AgonesTest\UE4Editor-AgonesTest.suppressed.lib and object E:\UE4PrivateExamples\AgonesTest\Intermediate\Build\Win64\UE4Editor\Development\AgonesTest\UE4Editor-AgonesTest.suppressed.exp
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command "C:\UnrealEngine\UE_4.24\Engine\Build\BatchFiles\Build.bat AgonesTestEditor Win64 Development -Project="E:\UE4PrivateExamples\AgonesTest\AgonesTest.uproject" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.
Done building project "AgonesTest.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Anything else we need to know?:

I have a fix for this already. I'm preparing a PR now.

Environment:

  • Agones version: 1.13 and master as of 676a7b5328d10
  • Kubernetes version (use kubectl version): n/a
  • Cloud provider or hardware configuration: n/a
  • Install method (yaml/helm): n/a
kinbug areuser-experience

All 4 comments

I have a fix for this for both master and the 1.13 branch. The problem is that in UE 4.24, Unreal Build Tool introduced the concept of default build settings. Build settings determine how include directories are searched.

By default in UE 4.24, projects use build settings v2, which requires include path prefixes.

Here's an example V1 (legacy) target.cs file:

```c#
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class AgonesTestEditorTarget : TargetRules
{
public AgonesTestEditorTarget( TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
DefaultBuildSettings = BuildSettingsVersion.V1;
ExtraModuleNames.AddRange( new string[] { "AgonesTest" } );
}
}


Here's an example V2 (new) target.cs:

```c#
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class AgonesTestEditorTarget : TargetRules
{
    public AgonesTestEditorTarget( TargetInfo Target) : base(Target)
    {
        Type = TargetType.Editor;
        DefaultBuildSettings = BuildSettingsVersion.V2;
        ExtraModuleNames.AddRange( new string[] { "AgonesTest" } );
    }
}

/assign @dzlier-gcp

I had the same problem when compiling spout on unreal Version: 4.24.3-11590370.

Finding the files where stated V2 and changing to V1 made the project build.

Thanks!

see this, https://bbs.comblockengine.com/forum.php?mod=viewthread&tid=8889&extra= ,it may help you , similar question of yours.

已经解决,参考UE4 demo 的代码,修改空白的UE4 工程, 最终编译通过, 主要进行的修改是 删除了一行代码,但是我还不知道是什么原因Source/KBELearnPro.Target.csSource/KBELearnProEditor.Target.cs这两个文件里面,都删除了DefaultBuildSettings = BuildSettingsVersion.V2;复制代码这一行代码, 最终编译通过

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmaeso picture jmaeso  ·  5Comments

jehan96 picture jehan96  ·  5Comments

aLekSer picture aLekSer  ·  4Comments

markmandel picture markmandel  ·  6Comments

adamhosier picture adamhosier  ·  5Comments