Announcement

Collapse
No announcement yet.

Is this a bug or I am doing something wrong?

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

  • replied
    I found that this is not an isolate case. In fact, it happens also in other two cases:

    UWorld
    if I try to use a UWorld*, so calling this in the code, any function:
    Code:
    GetWorld()->GetGameInstance();
    AND I have this in the build file:
    Code:
    PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
    Then compiling for Android results in this error:
    Code:
    error: member access into incomplete type 'UWorld'
    unless I either drop the dependency to Slate and SlateCore or I use
    Code:
    #include "Engine/World.h"
    FTimerManager
    Similar if I use the FTimerManager, like adding this in any code:
    GetWorld()->GetTimerManager();

    AND I have this in the build file:
    Code:
    PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
    Then compiling for Android results in this error:
    Code:
    error: member access into incomplete type 'FTimerManager'
    unless I either drop the dependency to Slate and SlateCore or I use
    Code:
    #include "TimerManager.h"
    Is this a bug?

    The fact that this error appears only when there is the dependency to Slate and SlateCore makes me believe that it is, so unless some of you have some explanation, I will submit a report ticket as a bug. Thankfully for the meantime I have a workaround (using the Include files).

    Leave a comment:


  • started a topic Is this a bug or I am doing something wrong?

    Is this a bug or I am doing something wrong?

    Dear everyone,

    I found this weird bug, and I wanted to check with you if it is really a bug before submitting a ticket.

    Steps to reproduce it

    I have been using UE4.24.3 and VS2019.
    1. Create a new empty C++ project.
    2. Add in the PrivateDependencyModuleNames the following (it is already there, you need to uncomment it):
      Code:
      PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
    3. Create a new C++ class, e.g. an actor named MyActor.
    4. Create a new function that contains an FText Property and it is a UFUNCTION, like the following:
      Code:
      UFUNCTION(BlueprintCallable)
      	void MyFunction(FText MyParameter);
    5. The definition in the .cpp can be empty:
      Code:
      void AMyActor::MyFunction(FText MyParameter)
      	{
      	}
    6. Package or Launch the project on an Android Device.

    This is the error that I got (the project is called TestAndroid2):
    Code:
    [2/5] MyActor.cpp [armv7-es2]
    LogPlayLevel:     In file included from D:/Unreal Projects/TestingProjects/TestAndroid2/Source/TestAndroid2/MyActor.cpp:4:
    LogPlayLevel: Error:     D:/Unreal Projects/TestingProjects/TestAndroid2/Source/TestAndroid2/MyActor.h(13,2):  error: incomplete type 'UTextProperty' named in nested name specifier
    LogPlayLevel:             GENERATED_BODY()
    LogPlayLevel:             ^~~~~~~~~~~~~~~~
    LogPlayLevel:     C:/Program Files/Epic Games/UE_4.24/Engine/Source/Runtime/CoreUObject/Public\UObject/ObjectMacros.h(593,29):  note: expanded from macro 'GENERATED_BODY'
    LogPlayLevel:     #define GENERATED_BODY(...) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_GENERATED_BODY);
    LogPlayLevel:                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    LogPlayLevel:     C:/Program Files/Epic Games/UE_4.24/Engine/Source/Runtime/CoreUObject/Public\UObject/ObjectMacros.h(588,37):  note: expanded from macro 'BODY_MACRO_COMBINE'
    LogPlayLevel:     #define BODY_MACRO_COMBINE(A,B,C,D) BODY_MACRO_COMBINE_INNER(A,B,C,D)
    LogPlayLevel:                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    LogPlayLevel:     C:/Program Files/Epic Games/UE_4.24/Engine/Source/Runtime/CoreUObject/Public\UObject/ObjectMacros.h(587,43):  note: expanded from macro 'BODY_MACRO_COMBINE_INNER'
    LogPlayLevel:     #define BODY_MACRO_COMBINE_INNER(A,B,C,D) A##B##C##D
    LogPlayLevel:                                               ^~~~~~~~~~
    LogPlayLevel:     note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
    LogPlayLevel:     D:/Unreal Projects/TestingProjects/TestAndroid2/Intermediate/Build/Android/UE4/Inc/TestAndroid2\MyActor.generated.h(102,2):  note: expanded from macro 'TestAndroid2_Source_TestAndroid2_MyActor_h_13_GENERATED_BODY'
    LogPlayLevel:             TestAndroid2_Source_TestAndroid2_MyActor_h_13_RPC_WRAPPERS_NO_PURE_DECLS \
    LogPlayLevel:             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    LogPlayLevel:     D:/Unreal Projects/TestingProjects/TestAndroid2/Intermediate/Build/Android/UE4/Inc/TestAndroid2\MyActor.generated.h(33,18):  note: expanded from macro 'TestAndroid2_Source_TestAndroid2_MyActor_h_13_RPC_WRAPPERS_NO_PURE_DECLS'
    LogPlayLevel:                     P_GET_PROPERTY(UTextProperty,Z_Param_MyParameter); \
    LogPlayLevel:                     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    LogPlayLevel:     C:/Program Files/Epic Games/UE_4.24/Engine/Source/Runtime/CoreUObject/Public\UObject/ScriptMacros.h(44,2):  note: expanded from macro 'P_GET_PROPERTY'
    LogPlayLevel:             PropertyType::TCppType ParamName = PropertyType::GetDefaultPropertyValue();                                     \
    LogPlayLevel:             ^~~~~~~~~~~~~~
    LogPlayLevel:     C:/Program Files/Epic Games/UE_4.24/Engine/Source/Runtime/Core/Public\UObject/UObjectHierarchyFwd.h(33,10):  note: forward declaration of 'UTextProperty'
    LogPlayLevel:     class                           UTextProperty;
    LogPlayLevel:                                     ^
    LogPlayLevel:     In file included from D:/Unreal Projects/TestingProjects/TestAndroid2/Source/TestAndroid2/MyActor.cpp:4:
    LogPlayLevel: Error:     D:/Unreal Projects/TestingProjects/TestAndroid2/Source/TestAndroid2/MyActor.h(13,2):  error: incomplete type 'UTextProperty' named in nested name specifier
    LogPlayLevel:             GENERATED_BODY()
    LogPlayLevel:             ^~~~~~~~~~~~~~~~
    LogPlayLevel:     C:/Program Files/Epic Games/UE_4.24/Engine/Source/Runtime/CoreUObject/Public\UObject/ObjectMacros.h(593,29):  note: expanded from macro 'GENERATED_BODY'
    LogPlayLevel:     #define GENERATED_BODY(...) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_GENERATED_BODY);
    LogPlayLevel:                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    LogPlayLevel:     C:/Program Files/Epic Games/UE_4.24/Engine/Source/Runtime/CoreUObject/Public\UObject/ObjectMacros.h(588,37):  note: expanded from macro 'BODY_MACRO_COMBINE'
    LogPlayLevel:     #define BODY_MACRO_COMBINE(A,B,C,D) BODY_MACRO_COMBINE_INNER(A,B,C,D)
    LogPlayLevel:                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    LogPlayLevel:     C:/Program Files/Epic Games/UE_4.24/Engine/Source/Runtime/CoreUObject/Public\UObject/ObjectMacros.h(587,43):  note: expanded from macro 'BODY_MACRO_COMBINE_INNER'
    LogPlayLevel:     #define BODY_MACRO_COMBINE_INNER(A,B,C,D) A##B##C##D
    LogPlayLevel:                                               ^~~~~~~~~~
    LogPlayLevel:     note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
    LogPlayLevel:     D:/Unreal Projects/TestingProjects/TestAndroid2/Intermediate/Build/Android/UE4/Inc/TestAndroid2\MyActor.generated.h(102,2):  note: expanded from macro 'TestAndroid2_Source_TestAndroid2_MyActor_h_13_GENERATED_BODY'
    LogPlayLevel:             TestAndroid2_Source_TestAndroid2_MyActor_h_13_RPC_WRAPPERS_NO_PURE_DECLS \
    LogPlayLevel:             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    LogPlayLevel:     D:/Unreal Projects/TestingProjects/TestAndroid2/Intermediate/Build/Android/UE4/Inc/TestAndroid2\MyActor.generated.h(33,18):  note: expanded from macro 'TestAndroid2_Source_TestAndroid2_MyActor_h_13_RPC_WRAPPERS_NO_PURE_DECLS'
    LogPlayLevel:                     P_GET_PROPERTY(UTextProperty,Z_Param_MyParameter); \
    LogPlayLevel:                     ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    LogPlayLevel:     C:/Program Files/Epic Games/UE_4.24/Engine/Source/Runtime/CoreUObject/Public\UObject/ScriptMacros.h(44,37):  note: expanded from macro 'P_GET_PROPERTY'
    LogPlayLevel:             PropertyType::TCppType ParamName = PropertyType::GetDefaultPropertyValue();                                     \
    LogPlayLevel:                                                ^~~~~~~~~~~~~~
    LogPlayLevel:     C:/Program Files/Epic Games/UE_4.24/Engine/Source/Runtime/Core/Public\UObject/UObjectHierarchyFwd.h(33,10):  note: forward declaration of 'UTextProperty'
    LogPlayLevel:     class                           UTextProperty;
    LogPlayLevel:                                     ^
    LogPlayLevel:     2 errors generated.
    LogPlayLevel:     [3/5] MyActor.gen.cpp [armv7-es2]
    LogPlayLevel: Took 9.7787936s to run UnrealBuildTool.exe, ExitCode=5
    Workaround
    However, I have found a way to make it compile and work, but I feel it is more a workaround, rather than the proper way to go.
    If you include at the beginning of your MyActor.h the following include:
    Code:
    #include "UObject/TextProperty.h"
    Then, everything compiles without any problems.

    Of course, if you remove the PrivateDependency to Slate and SlateCore, everything compiles.

    Is this a bug?
    Can someone try if this produces a compiling error? Is there a way to proceed, or is it a bug and should I submit a ticket?
Working...
X