Session Delegates undefined even after module and include

I have linked the modules in the build.cs file

I have included the correct headers in the project header file

I have cleaned, rebuilt, regenerated, closed and opened numerous times.

Still getting the error:
Identifier “FOnCreateSessionCompleteDelegate” is undefined.

Any help would be appreciated! :slight_smile: Thank you in advance

Code Below:

/** PRIVATE VARIABLES */
    private:
    
    	/*Delegate called when session created*/
    	FOnCreateSessionCompleteDelegate OnCreateSessionCompleteDelegate;
    
    	/*Delegate called when session started*/
    	FOnStartSessionCompleteDelegate OnStartSessionCompleteDelegate;

ProjectBuildName.build.cs file

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class AdvancedNetworking : ModuleRules
{
	public AdvancedNetworking(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "OnlineSubsystem", "OnlineSubsystemUtils" });

        if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Linux) || (Target.Platform == UnrealTargetPlatform.Mac))
        {
            PublicDependencyModuleNames.AddRange(new string[] { "Steamworks" });
        }

    }
}

ProjectName Header file

AdvancedNetworking.h

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "Engine.h"
#include "UnrealNetwork.h"
#include "Online.h"

You may need to include “AdvancedNetworking.h” manually where you need it, but it’s better to use IWYU instead include
“Engine.h”.

One thing that solved for me was to right click on .uproject and Generate Visual studio Files from there, here is where I saw this method:
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/21670-can-t-include-online-h-even-after-altering-build-cs

I had the same problem and solved it by including “Online.h” to my GameInstance project.