Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UE4 plugin fails to compile with default UE4 4.24 project #1318

Closed
drichardson opened this issue Feb 5, 2020 · 4 comments · Fixed by #1319
Closed

UE4 plugin fails to compile with default UE4 4.24 project #1318

drichardson opened this issue Feb 5, 2020 · 4 comments · Fixed by #1319
Assignees
Labels
area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/bug These are bugs.
Milestone

Comments

@drichardson
Copy link
Contributor

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 676a7b5
  • Kubernetes version (use kubectl version): n/a
  • Cloud provider or hardware configuration: n/a
  • Install method (yaml/helm): n/a
@drichardson drichardson added the kind/bug These are bugs. label Feb 5, 2020
@drichardson
Copy link
Contributor Author

drichardson commented Feb 5, 2020

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:

// 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:

// 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" } );
	}
}

@drichardson
Copy link
Contributor Author

/assign @dzlier-gcp

@markmandel markmandel added this to the 1.4.0 milestone Feb 26, 2020
@markmandel markmandel added the area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc label Feb 26, 2020
@Weckmuller
Copy link

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!

@MacroGu
Copy link

MacroGu commented Sep 15, 2020

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;复制代码这一行代码, 最终编译通过

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/bug These are bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants