UStruct Compiler Error.

why im getting compiler error when i add a value to either structs :

#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "Engine/DataTable.h"
#include "MyStructLibrary.generated.h"
USTRUCT(BlueprintType)
struct FEffectStruct : public FTableRowBase
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
FString NameOfPhysicalSound;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
USoundBase* HitSound;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
class UNiagaraSystem* NiagaraSystemIn;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
FVector ScaleNiagaraSystemIn = FVector(1);
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
class UNiagaraSystem* NiagaraSystemOut;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
FVector ScaleNiagaraSystemOut = FVector(1);
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
UMaterialInterface* DecalMat;
// ... Other properties and functions specific to FMyStruct1
};
USTRUCT(BlueprintType)
struct FSwordEffectStruct : public FTableRowBase
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
FString NameOfPhysicalSound;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
USoundBase* HitSound;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
class UNiagaraSystem* NiagaraSystemIn;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
FVector ScaleNiagaraSystemIn = FVector(1);
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
class UNiagaraSystem* NiagaraSystemOut;

//Either add this value or any other value that would cause a compiler error.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EffectStruct")
int32 Test =0;
};
UCLASS(BlueprintType)
class THESKYABOVETHECLOUDS_API UMyStructLibrary : public UObject
{
GENERATED_BODY()
public:

// ... Other class members and functions
};

Hi!

Can you, please, provide text of an error?

The line

// ... Other properties and functions specific to FMyStruct1

probably is the part where it fails. Structs & functions don’t mix well

Thanks for the replay, I don’t have any function in my UStruct body!

sure :

Severity Code Description Project File Line Suppression State
Error MSB3073 The command F:\Program Files\Epic Games\UE_5.2\Engine\Build\BatchFiles\Build.bat TheSkyAboveTheCloudsEditor Win64 Development -Project=F:\Unreal Projects\TheSkyAboveTheClouds\TheSkyAboveTheClouds.uproject -WaitMutex -FromMsBuild exited with code 6. TheSkyAboveTheClouds C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets 44
Error (active) E1835 attribute deprecated does not apply here TheSkyAboveTheClouds F:\Program Files\Epic Games\UE_5.2\Engine\Source\Runtime\CoreUObject\Public\Serialization\BulkData.h 277
Error (active) E1835 attribute deprecated does not apply here TheSkyAboveTheClouds F:\Program Files\Epic Games\UE_5.2\Engine\Source\Runtime\CoreUObject\Public\Serialization\BulkData.h 1201
Error (active) E0415 no suitable constructor exists to convert from UPTRINT to UE::CoreUObject::Private::FPackedObjectRef TheSkyAboveTheClouds F:\Program Files\Epic Games\UE_5.2\Engine\Source\Runtime\CoreUObject\Public\UObject\PackedObjectRef.h 32
Error (active) E0070 incomplete type is not allowed TheSkyAboveTheClouds F:\Program Files\Epic Games\UE_5.2\Engine\Source\Runtime\Core\Public\Containers\StringView.h 406
Error (active) E0070 incomplete type is not allowed TheSkyAboveTheClouds F:\Program Files\Epic Games\UE_5.2\Engine\Source\Runtime\Core\Public\Containers\StringView.h 413
Error (active) E1455 member function declared with ‘override’ does not override a base class member TheSkyAboveTheClouds F:\Program Files\Epic Games\UE_5.2\Engine\Source\Runtime\Core\Public\Serialization\ArchiveProxy.h 157
Error (active) E1455 member function declared with ‘override’ does not override a base class member TheSkyAboveTheClouds F:\Program Files\Epic Games\UE_5.2\Engine\Source\Runtime\Core\Public\Serialization\ArchiveProxy.h 167
Error C2061 syntax error: identifier ‘AAiBaseTopDownCharacter’ TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.h 20
Error C2061 syntax error: identifier ‘AAiBaseTopDownCharacter’ TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.h 22
Error C2065 ‘AAiBaseTopDownCharacter’: undeclared identifier TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.h 25
Error C2059 syntax error: ‘>’ TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.h 25
Error C2618 illegal member designator in offsetof TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Intermediate\Build\Win64\UnrealEditor\Inc\TheSkyAboveTheClouds\UHT\TheSkyAboveTheCloudsGameMode.gen.cpp 60
Error C2065 ‘ESwordTypeAttack’: undeclared identifier TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\AAIControllerRelated\UBTTask_Attack.h 33
Error C2923 ‘TEnumAsByte’: ‘ESwordTypeAttack’ is not a valid template type argument for parameter ‘TEnum’ TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\AAIControllerRelated\UBTTask_Attack.h 33
Error C2955 ‘TEnumAsByte’: use of class template requires template argument list TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\AAIControllerRelated\UBTTask_Attack.h 33
Error C2512 ‘TEnumAsByte’: no appropriate default constructor available TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Intermediate\Build\Win64\UnrealEditor\Inc\TheSkyAboveTheClouds\UHT\UBTTask_Attack.gen.cpp 142
Error C2660 ‘ATheSkyAboveTheCloudsGameMode::RemoveDettectedAI’: function does not take 1 arguments TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\AAIControllerRelated\AIControllerV1.cpp 108
Error C2660 ‘ATheSkyAboveTheCloudsGameMode::AddDettectedAI’: function does not take 1 arguments TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\AAIControllerRelated\AIControllerV1.cpp 250
Error C2512 ‘TEnumAsByte’: no appropriate default constructor available TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\AAIControllerRelated\UBTTask_Attack.cpp 18
Error C2450 a switch expression of type ‘TEnumAsByte’ is not valid TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\AAIControllerRelated\UBTTask_Attack.cpp 72
Warning C4005 ‘LOCTEXT_NAMESPACE’: macro redefinition TheSkyAboveTheClouds F:\Program Files\Epic Games\UE_5.2\Engine\Source\Runtime\UMG\Public\Blueprint\UserWidget.h 1514
Error C2672 ‘begin’: no matching overloaded function found TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.cpp 46
Error C2672 ‘end’: no matching overloaded function found TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.cpp 46
Error C3536 ‘$L0’: cannot be used before it is initialized TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.cpp 47
Error C3536 ‘$L0’: cannot be used before it is initialized TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.cpp 47
Error C2100 illegal indirection TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.cpp 46
Error C2440 ‘initializing’: cannot convert from ‘int’ to ‘AAiBaseTopDownCharacter *’ TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.cpp 46
Error C2511 ‘void ATheSkyAboveTheCloudsGameMode::AddDettectedAI(AAiBaseTopDownCharacter *)’: overloaded member function not found in ‘ATheSkyAboveTheCloudsGameMode’ TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.cpp 58
Error C2511 ‘void ATheSkyAboveTheCloudsGameMode::RemoveDettectedAI(AAiBaseTopDownCharacter *)’: overloaded member function not found in ‘ATheSkyAboveTheCloudsGameMode’ TheSkyAboveTheClouds F:\Unreal Projects\TheSkyAboveTheClouds\Source\TheSkyAboveTheClouds\TheSkyAboveTheCloudsGameMode.cpp 62

its just nonsense errors.

How about the Ouput field of VS? (I’m guessing you are using visual studio)

Do you have all the needed modules in your build file?

  • Niagara
  • Engine

yes.
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "NavigationSystem", "AIModule", "Niagara", "EnhancedInput", "GameplayTasks" , "DismembermentSystem" , "PhysicsCore" , "UMG" });