Can't build server target with UE 4.14

Hey Arthur,

Thanks for the report.

As with all uses under the UE Github Master branch, you run the risk of having code that is not yet complete or is still being worked on. There is also a chance that you will get a commit that has not yet been fully pushed to GitHub as it is not uncommon internally to have a wave of commits come in at a time, which rely on others not yet committed / pushed to GitHub.

Now, if you see this same issue in the latest stable release (4.13.1), please post under the Bug Reports section with steps to reproduce the issue.

For now, I would highly recommend using the latest stable release for any serious project.

Hello.

I have compiled UE from 4.14 branch and now I am trying to build my project.

But it falls with error:

Running e:/UnrealEngine/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="E:/MyGame/MyGame.uproject" -game -engine -progress
Discovering modules, targets and source code for project...
Messages while compiling E:\MyGame\Intermediate\Build\BuildRules\MyGameModuleRules.dll:
e:\MyGame\Source\MyGameServer.Target.cs(32,48) : error CS0115: "MyGameServerTarget.GUBP_GetPlatforms_MonolithicOnly(UnrealBuildTool.UnrealTargetPlatform)": ?? ?????? ??⮤, ?ਣ????? ??? ??८?।??????
e:\MyGame\Source\MyGameServer.Target.cs(41,53) : error CS0115: "MyGameServerTarget.GUBP_GetConfigs_MonolithicOnly(UnrealBuildTool.UnrealTargetPlatform, UnrealBuildTool.UnrealTargetPlatform)": ?? ?????? ??⮤, ?ਣ????? ??? ??८?।??????
UnrealBuildTool Exception: ERROR: UnrealBuildTool encountered an error while compiling source files

MyGameServer.Target.cs has code from A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums sample:

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
 
using UnrealBuildTool;
using System.Collections.Generic;
 
public class MyGameServerTarget : TargetRules
{
    public MyGameServerTarget(TargetInfo Target)
    {
        Type = TargetType.Server;
    }
 
    //
    // TargetRules interface.
    //
    public override void SetupBinaries(
        TargetInfo Target,
        ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
        ref List<string> OutExtraModuleNames
        )
    {
        base.SetupBinaries(Target, ref OutBuildBinaryConfigurations, ref OutExtraModuleNames);
        OutExtraModuleNames.Add("MyGame");
    }
 
    public override bool GetSupportedPlatforms(ref List<UnrealTargetPlatform> OutPlatforms)
    {
        // It is valid for only server platforms
        return UnrealBuildTool.UnrealBuildTool.GetAllServerPlatforms(ref OutPlatforms, false);
    }
 
    public override List<UnrealTargetPlatform> GUBP_GetPlatforms_MonolithicOnly(UnrealTargetPlatform HostPlatform)
    {
        if (HostPlatform == UnrealTargetPlatform.Mac)
        {
            return new List<UnrealTargetPlatform>();
        }
        return new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Win32, UnrealTargetPlatform.Linux };
    }
 
    public override List<UnrealTargetConfiguration> GUBP_GetConfigs_MonolithicOnly(UnrealTargetPlatform HostPlatform, UnrealTargetPlatform Platform)
    {
        return new List<UnrealTargetConfiguration> { UnrealTargetConfiguration.Development };
    }
}

How to fix that?

How to compile game project with server target?

Thank you!

But how to fix that?

I want to try build server target for 4.14 test branch.

I found that!

In commit for RulesCompiler.cs (2016/09/30, 63ab3d83c240d17ea70ec201f2626c6405dda553) there is interesting comment

"Change 3132815 on 2016/09/20 by Ben.Marsh

AutomationTool: Delete GUBP. Everything now uses BuildGraph!"

How to make server target with BuildGraph?

Hey again,

I downloaded the GitHub Master Branch and compiled it for Development Server as well as packaged the game. All is working as you would expect.

If you continue to have an issue, again either sync to a the most recent release version( 4.13.1 ) or try again with the master branch. As mentioned before, the master branch is not stable. Do not expect for it to always work.

Hi.

Can you show your *Server.Target.cs file, that you used to compile UE Dev Server?

Your answers on this issue are very bad.They do not have the specifics.

Hey Arthur,

Again, to be very clear, the GitHub Master Branch is not stable. This is my answer for your issue. If you are having a crash, assert, or packaging error on the GitHub Master Branch there is a good chance it is for this reason. This is why we always recommend not seriously using the GitHub Master Branch and instead use the most recent stable release, which is current 4.13.1.

There is also another issue using the GitHub Master Branch. Because it is updated multiple times a day when you download a version and then post a issue with it, I go to download it and there is a chance that my version of the GitHub Master Branch will be different from yours, resulting in different results.

Furthermore, if we cannot reproduce the issue, we are unable to take any further action with the issue. If we come back to you with the response that we cannot reproduce your issue, it is up to you to break down what you are doing and explain your issue with more detail so we can test it.

Finally, here is the networking tutorials that we use for making multiplayer games with Unreal 4 as well as the packaging tutorials we use for compiling the server exe:

https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)
https://docs.unrealengine.com/latest/INT/Gameplay/Networking/
https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Blueprints/
https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/Networking/
https://www.unrealengine.com/blog/blueprint-networking-tutorials

I upgraded to 4.14 and get errors around the GUBP missing. I am in the process of looking for how to change my server.target.cs. I used the same link to get it to work in 4.13.2 successfully.

I created a new empty C++ 4.14 project to see what I can figure out what needs deleted and added.

Same here !

Removed:

    public override List<UnrealTargetPlatform> GUBP_GetPlatforms_MonolithicOnly(UnrealTargetPlatform HostPlatform)
    {
        if (HostPlatform == UnrealTargetPlatform.Mac)
        {
            return new List<UnrealTargetPlatform>();
        }
        return new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Win32, UnrealTargetPlatform.Linux };
    }
 
    public override List<UnrealTargetConfiguration> GUBP_GetConfigs_MonolithicOnly(UnrealTargetPlatform HostPlatform, UnrealTargetPlatform Platform)
    {
        return new List<UnrealTargetConfiguration> { UnrealTargetConfiguration.Development };
    }

I can do a build now of my code after I navigated to \Engine\Source\Runtime\PakFile\Private\IPlatformFilePak.cpp(23):#define EXCLUDE_NONPAK_UE_EXTENSIONS USE_NEW_ASYNC_IO // Use .Build.cs file to disable this if the game relies on accessing loose files

and I right clicked on my project and selected build.

Now to test to see if it actually build the dedicated server correctly.

Seems to work now.

4.14 released but still not fixed…

Hi, same problem here, using 4.14 from the launcher (never used github).

Cedric

Same here with 4.14 from github… Any update on this?

Same problem here. I tried both launcher and source UE4.14.0-release.

I will try your solution.

Same problem here. I tried both launcher and source UE4.14.0-release

I was stuck with this last night as well. I just stumbled across this potential unofficial fix… Give it a shot.

It let me get past the step that was blocking me. Trying the rest of the steps found at A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums now.

Just to further clarify since I was staring at this last night and didn’t realize that code was in the new Server Target file we were supposed to add… Copy pasting my comment from below.

===

I was stuck with this last night as well. I just stumbled across this potential unofficial fix… Give it a shot.

It let me get past the step that was blocking me. Trying the rest of the steps found at A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums now.

I found working UE4GameServer.target.cs here , worked on the 4.20.

using UnrealBuildTool;
using System.Collections.Generic;

public class GenericShooterServerTarget : TargetRules
{
	public GenericShooterServerTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Server;

		ExtraModuleNames.Add("UE4Game"); // This would be your project module if not BP only
	}

	//
	// TargetRules interface.
	//

	public override void SetupGlobalEnvironment(
		TargetInfo Target,
		ref LinkEnvironmentConfiguration OutLinkEnvironmentConfiguration,
		ref CPPEnvironmentConfiguration OutCPPEnvironmentConfiguration
		)
	{
	}
}