Cannot include header in Classes folder

I am trying to include the file OnlineSubsystemUtils\Classes\FindSessionsCallbackProxy.h in my plugin code. The compiler says it cannot find it, and I cannot understand why. The file OnlineSubsystem\Public\Interfaces\OnlineSessionInterface.h, on the other hand, is included without errors.

My guess is that, when linking to modules, it is only allowed to include files in the Public folder, while FindSessionsCallbackProxy.h is in Classes (but I read that Classes was the only place to declare UOBJECTS, so this seems strange to me).

This is my header with the include, which is in Private\IndoFunctionLibrary.h

#pragma once

#include "OnlineSessionInterface.h"
#include "FindSessionCallbackProxy.h"
#include "IndoFunctionLibrary.generated.h"

UCLASS()
class UIndoFunctionLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
 
	UFUNCTION(BlueprintPure, Category="Session")
	static FString GetSessionResultStringSetting(const FBlueprintSessionResult& Result, const FName& Key);
};

In the build.cs I have this:

PrivateDependencyModuleNames.AddRange(
			new string[]
			{
				"CoreUObject",
				"Engine",
				"Slate",
				"SlateCore",
				"OnlineSubsystem",
				"OnlineSubsystemUtils",
                "Sockets",
				// ... add private dependencies that you statically link with here ...	
			}
			);

When compiling I get this error:

Private/IndoFunctionLibrary.h(3): fatal error C1083: Cannot open include file: 'FindSessionCallbackProxy.h': No such file or directory

Someone knows how I can include FindSessionCallbackProxy.h without errors?

1 Like

#pragma once

 #include "OnlineSessionInterface.h"
 #include "FindSESSIONSCallbackProxy.h" <----------------
 #include "IndoFunctionLibrary.generated.h"
 
 UCLASS()
 class UIndoFunctionLibrary : public UBlueprintFunctionLibrary
 {
     GENERATED_BODY()
  
     UFUNCTION(BlueprintPure, Category="Session")
     static FString GetSessionResultStringSetting(const FBlueprintSessionResult& Result, const FName& Key);
 };

Hope that helps :).

Aaargh, such a stupid mistake! Thank you!