Announcement

Collapse
No announcement yet.

Issue with include files for unreal basic types

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Issue with include files for unreal basic types

    Hey there,

    I'm struggeling with includes. I have code that was working 4hours ago and now it is not... telling me types are unknown.
    Here is the code (whole file).
    Code:
    #pragma once
    
    
    class FDirectoryFileCounter : public IPlatformFile::FDirectoryVisitor
    {
        uint64 numFiles = 0 ;
        uint64 numDirs = 0;
    public:
    
        virtual bool Visit(const TCHAR* FilenameOrDirectory, bool bIsDirectory)
        {
            if (bIsDirectory)
            {
                ++numDirs;
            }
            else
            {
                ++numFiles;
            }
            return true;
        }
    
        uint64 GetNumFiles() { return numFiles; }
        uint64 GetNumDirs() { return numDirs; }
    };
    This was working, as the types IPlatformFile::FDirectoryVisitor should be included through the basic includes of the engine, done via the build.cs file.?
    There is the build.cs

    Code:
    // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
    
    using UnrealBuildTool;
    
    public class SteamWorkshop: ModuleRules
    {
        public SteamWorkshop(ReadOnlyTargetRules Target) : base(Target)
        {
            PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
    
            PublicIncludePaths.AddRange(
                new string[] {
                    "SteamWorkshop/Public"
                    // ... add public include paths required here ...
                }
                );
    
    
            PrivateIncludePaths.AddRange(
                new string[] {
                    "SteamWorkshop/Private",
                    // ... add other private include paths required here ...
                }
                );
    
    
            PublicDependencyModuleNames.AddRange(
                new string[]
                {
                    "Core",
                    "OnlineSubsystem",
                    "OnlineSubsystemUtils",
                    "OnlineSubsystemSteam",
                    "SteamworksCustom",
                    // ... add other public dependencies that you statically link with here ...
                }
                );
    
    
            PrivateDependencyModuleNames.AddRange(
                new string[]
                {
                    "CoreUObject",
                    "Engine",
    
            // ... add private dependencies that you statically link with here ...    
                }
                );
    
    
            DynamicallyLoadedModuleNames.AddRange(
                new string[]
                {
                    // ... add any modules that your module loads dynamically here ...
                }
                );
        }
    }
    As unreal has a pretty old implementation of Steam SDK, I'm forced to include the current Steam SDK version manually. So I made another module that has the SDK in it and changed the build.cs file to depend on SteamworksCustom instead of Steamworks. Now everything seems to go viral and I have no idea why. Why is it complaining on a file that has nothing to do with this, does not even depend on the steam stuff .

    I tried to go back to the unreal Steam SDK (Steamworks module) but the include issue persists...

    There are also other files that have issues with the basic types. What could have caused this? Already tried rebuilding, deleting intermediate files.
    NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

    #2
    This was working, as the types IPlatformFile::FDirectoryVisitor should be included through the basic includes of the engine, done via the build.cs file.?
    Build.cs just tells the compiler what directories to look in when searching for an include. You still have to include the file.

    #include "GenericPlatform\GenericPlatformFile.h"
    Able Ability System - A high performance, robust ability system for UE4. Now Available!

    Comment


      #3
      Originally posted by ExtraLifeMatt View Post

      Build.cs just tells the compiler what directories to look in when searching for an include. You still have to include the file.

      Thanks for your reply.
      Thats the strange thing when working with Unreal. Sometimes you do need to include, sometimes not. As said. it WAS working without, for what ever reason...
      NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

      Comment


        #4
        Originally posted by Rumbleball View Post

        Thanks for your reply.
        Thats the strange thing when working with Unreal. Sometimes you do need to include, sometimes not. As said. it WAS working without, for what ever reason...
        The reason why that happens is because sometimes your file can be included in a unified header (ModuleNameXofY.cpp), which happens to have other classes that included the file you needed. However, if UHT detects changes in that file, it removes it from the unified header so your file gets compiled alone (and thus ends up missing includes).
        Able Ability System - A high performance, robust ability system for UE4. Now Available!

        Comment


          #5
          Ah, didn't know about that, thanks for the insight. Unfortunately, I'm not able to find any usefull information regarding unified headers, expect the term itself beeing used. Do you have any ressource that describes what those are and when they are put together?
          NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

          Comment

          Working...
          X