OnlineSubsystem is missing

Hello, i’m trying to use OnlineSubsystem to host and find games over LAN only. Because of this, i’m sticking with null implementation, but the reference seems to be missing.

I get the error “c2065: ‘IOnlineSubsystem’: undeclared identifier” when i try to use the “IOnlineSubsystem” namespace. Maybe i’m missing any #include ? Which one is required ?

Here is my setup:

DefaultEngine.ini

[Core.Log]
LogOnline=verbose
LogAnalytics=log

[OnlineSubsystem]
DefaultPlatformService=Null

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[/Script/OnlineSubsystemUtils.IpNetDriver]
InitialConnectTimeout=120.0

Build.cs

public class UETest : ModuleRules
{
	public UETest(TargetInfo Target)
	{
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HTTP", "OnlineSubsystem", "OnlineSubsystemUtils" });

        PrivateDependencyModuleNames.AddRange(new string[] {  });

		// Uncomment if you are using Slate UI
		// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
        PrivateDependencyModuleNames.Add("OnlineSubsystem");
        if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
        {
            DynamicallyLoadedModuleNames.Add("OnlineSubsystemNull");
            //if (UEBuildConfiguration.bCompileSteamOSS == true)
            //{
            //    DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
            //}
        }
	}
}

Thanks in advance!

I found it, when setting up Network environment is also necessary to include “Online.h” on PROJECTNAME.h (header file) file, just add this line to it: #include "Online.h"

1 Like