x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: UE 4.11
Tags:
more ▼

asked May 19 '16 at 08:33 PM in C++ Programming

avatar image

matfer
115 10 16 24

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first
  #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 :).

more ▼

answered May 19 '16 at 09:38 PM

avatar image

Prometheus88
49 5 8 11

avatar image matfer May 20 '16 at 09:30 AM

Aaargh, such a stupid mistake! Thank you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question