Compiling problem UE\VS2022

I’m having trouble finding the cause of this error. I’m back on a project I haven’t worked on for a few months. Since then I got a new computer and the editor are installed fresh. However, my project won’t compile in VS Community. It did on my old computer and ran fine. It seems UHT is now balking on a certain file. I didn’t backup the compiled modules so I can’t open the project in UE.

I can’t see why the GENERATED_BODY() is being skipped.

I have:

  1. Cleaned the solution.
  2. Deleted the Intermediate, Saved and Binaries directories.
  3. Regenerated VS files.
  4. Spent an hour with ChatGPT.
  5. Spent 2 hours on Google.
  6. Added every component that might be required by VS.
  7. Tried upgrading project from 5.3 to 5.5

Here my output log:

Build started at 3:12 PM...
1>------ Build started: Project: DungeonGame, Configuration: Development_Editor x64 ------
1>Using bundled DotNet SDK version: 8.0.300
1>Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" DungeonGameEditor Win64 Development -Project="C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\DungeonGame.uproject" -WaitMutex -FromMsBuild -architecture=x64
1>Log file: C:\Users\kfpop\AppData\Local\UnrealBuildTool\Log.txt
1>Creating makefile for DungeonGameEditor (no existing makefile)
1>Parsing headers for DungeonGameEditor
1>  Running Internal UnrealHeaderTool C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\DungeonGame.uproject C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Intermediate\Build\Win64\DungeonGameEditor\Development\DungeonGameEditor.uhtmanifest -WarningsAsErrors -installed
1>C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Source\DungeonGame\DGAttributeSet.h(47): warning : The identifier 'GENERATED_BODY' was detected in a block being skipped. Was this intentional?
1>Total of 0 written
1>Total execution time: 1.59 seconds
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""C:\Program Files\Epic Games\UE_5.5\Engine\Build\BatchFiles\Build.bat" DungeonGameEditor Win64 Development -Project="C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\DungeonGame.uproject" -WaitMutex -FromMsBuild -architecture=x64" exited with code 6.
1>Done building project "DungeonGame.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 11 up-to-date, 0 skipped ==========
========== Build completed at 3:12 PM and took 02.079 seconds ==========

and here’s the header file DGAttributeSet.h:

// copyright pkh Lineworks. All Rights Reserved.



#pragma once


#include "GameplayEffect.h"
#include "CoreMinimal.h"

#include "AttributeSet.h"

#include "AbilitySystemComponent.h"

#include "Net/UnrealNetwork.h"

#include "DGAttributeSet.generated.h"



// Uses macros from AttributeSet.h

#define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \

	GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \

	GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \

	GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \

	GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName)



/**

 * 

 */

UCLASS()

class DUNGEONGAME_API UDGAttributeSet : public UAttributeSet

{

	GENERATED_BODY() // <----------------problem here?

	

public:

	UDGAttributeSet();



	virtual void PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) override;

	virtual void PostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data) override;

	virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;



	/** Current Mana, used to execute special abilities. Capped by MaxMana */

	UPROPERTY(BlueprintReadOnly, Category = "Abilities", ReplicatedUsing = OnRep_Mana)

	FGameplayAttributeData Mana;

	ATTRIBUTE_ACCESSORS(UDGAttributeSet, Mana)



	/** MaxMana is its own attribute, since GameplayEffects may modify it */

	UPROPERTY(BlueprintReadOnly, Category = "Abilities", ReplicatedUsing = OnRep_MaxMana)

	FGameplayAttributeData MaxMana;

	ATTRIBUTE_ACCESSORS(UDGAttributeSet, MaxMana)



	/** Current stamina, used when running and hiding */

	UPROPERTY(BlueprintReadOnly, Category = "Abilities", ReplicatedUsing = OnRep_Stamina)

	FGameplayAttributeData Stamina;

	ATTRIBUTE_ACCESSORS(UDGAttributeSet, Stamina)



protected:

	UFUNCTION()

	virtual void OnRep_Mana(const FGameplayAttributeData& OldValue);



	UFUNCTION()

	virtual void OnRep_MaxMana(const FGameplayAttributeData& OldValue);



	UFUNCTION()

	virtual void OnRep_Stamina(const FGameplayAttributeData& OldValue);

};

If you copied your code from somewhere (like ChatGPT) it might have non-standard whitespace and/or invisible characters that screw with UHT.

Just to test, try copying the definition from another class that definitely works and just type in this class name and comment out the functions (in the cpp as well so it compiles).

From what I can gather on your log, the error MSB3073, plus an exit code 6, has popped around the community from time to time. It’s usually tied to the build failing to launch a particular command, or a call to a missing/invalid module or plugin.

For either case, we need further information, which can be found in the extended log file, located at C:\Users\kfpop\AppData\Local\UnrealBuildTool\Log.txt. Please share the contents of that log, and we can try to pinpoint the issue’s origin.

Another possibility, since you mentioned having downloaded a new version of the editor, is that live coding is enabled by default, which can cause conflicts with VS. Can you try simply opening the editor (not from your project, you can make a blank project), then make sure this is disabled (lower right-hand corner):

Close all UE instances and try compiling again.

Here’s the log.

I notice a reference to OneDrive\Documents. I don’t use OneDrive, just the Documents folder on my computer. Could this be an issue?

Log started at 05/30/2025 16:46:52 (2025-05-30T23:46:52Z)
No config file at C:\Users\kfpop\OneDrive\Documents\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml
Configuration will be read from:
  C:\Users\kfpop\AppData\Roaming\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml
Setting temp directory to 'C:\Users\kfpop\AppData\Local\Temp\UnrealBuildTool\319625c3'
    Registering build platform: UnrealBuildTool.AndroidPlatformFactory
    Registering build platform: UnrealBuildTool.IOSPlatformFactory
    Registering build platform: UnrealBuildTool.LinuxPlatformFactory
    Registering build platform: UnrealBuildTool.MacPlatformFactory
    Registering build platform: UnrealBuildTool.TVOSPlatformFactory
    Registering build platform: UnrealBuildTool.WindowsPlatformFactory
Found Windows 10 SDK root at C:\Program Files (x86)\Windows Kits\10 (1)
Found Windows 10 SDK root at C:\Program Files (x86)\Windows Kits\10 (2)
Found Windows 10 SDK version 10.0.19041.0 at C:\Program Files (x86)\Windows Kits\10
Found Universal CRT version 10.0.19041.0 at C:\Program Files (x86)\Windows Kits\10
Found Windows 10 SDK version 10.0.22621.0 at C:\Program Files (x86)\Windows Kits\10
Found Universal CRT version 10.0.22621.0 at C:\Program Files (x86)\Windows Kits\10
Found Windows 10 SDK version 10.0.26100.0 at C:\Program Files (x86)\Windows Kits\10
Found Universal CRT version 10.0.26100.0 at C:\Program Files (x86)\Windows Kits\10
Win64 Installed SDK(s): MinVersion_Sdk=10.0.00000.0, MaxVersion_Sdk=10.9.99999.0, CurrentVersion_Sdk=10.0.26100.0, Version_AutoSdk=10.0.18362.0, CurrentVersion_AutoSdk=
        Registering build platform: Win64 - buildable: True
Command line: "C:\Program Files\Epic Games\UE_5.3\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" DungeonGameEditor Win64 DebugGame -Project=C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\DungeonGame.uproject -WaitMutex -FromMsBuild -Rebuild
Log file: C:\Users\kfpop\AppData\Local\UnrealBuildTool\Log.txt
Deleting old log file: C:\Users\kfpop\AppData\Local\UnrealBuildTool\Log-backup-2025.05.29-05.43.04.txt

Cleaning DungeonGameEditor binaries...
Skipping C:\Program Files\Epic Games\UE_5.3\Engine\Intermediate\Build\BuildRules\UE5Rules.dll: File is installed
Skipping C:\Program Files\Epic Games\UE_5.3\Engine\Intermediate\Build\BuildRules\UE5ProgramRules.dll: File is installed
Compiling C:\Users\kfpop\AppData\Local\UnrealEngine\Intermediate\Build\BuildRules\MarketplaceRules.dll: UnrealBuildTool.dll is newer
Adding event matcher: CompileEventMatcher
Adding event matcher: LinkEventMatcher
Adding event matcher: MicrosoftEventMatcher
Adding event matcher: XoreaxEventMatcher
Compiling C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Intermediate\Build\BuildRules\DungeonGameModuleRules.dll: UnrealBuildTool.dll is newer
Adding event matcher: CompileEventMatcher
Adding event matcher: LinkEventMatcher
Adding event matcher: MicrosoftEventMatcher
Adding event matcher: XoreaxEventMatcher
Found Visual Studio installation: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community (Product=Microsoft.VisualStudio.Product.Community, Version=16.11.36107.64)
Found Visual Studio installation: C:\Program Files\Microsoft Visual Studio\2022\Community (Product=Microsoft.VisualStudio.Product.Community, Version=17.14.36127.28)
Found Visual Studio toolchain: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532 (Family=14.36.32532, FamilyRank=0, Version=14.36.32548, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64, Error=False, Redist=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.44.35112)
Found Visual Studio toolchain: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130 (Family=14.38.33130, FamilyRank=4, Version=14.38.33145, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64, Error=False, Redist=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.38.33130)
Found Visual Studio toolchain: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207 (Family=14.44.35207, FamilyRank=4, Version=14.44.35208, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64, Error=False, Redist=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.44.35112)
Found Visual Studio toolchain: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207 (Family=14.44.35207, FamilyRank=4, Version=14.44.35208, Is64Bit=True, ReleaseChannel=Latest, Architecture=arm64, Error=False, Redist=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.44.35112)
Found Visual Studio toolchain: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207 (Family=14.44.35207, FamilyRank=4, Version=14.44.35208, Is64Bit=True, ReleaseChannel=Latest, Architecture=arm64ec, Error=False, Redist=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.44.35112)
  Find paths to clean took 2.8275825s
  Ensure no directory overlap took 1.56E-05s
  Ensure no file overlap took 0.0001567s
    Deleting C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Intermediate\Build\SourceFileCache.bin...
    Deleting C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Intermediate\Build\Win64\x64\DungeonGameEditor\DebugGame\...
    Deleting C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Intermediate\Build\Win64\x64\UnrealEditor\DebugGame\...
    Delete 1 files took 0.0022886s
    Delete directory 'C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Intermediate\Build\Win64\x64\UnrealEditor\DebugGame' took 0.0051096s
    Delete directory 'C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Intermediate\Build\Win64\x64\DungeonGameEditor\DebugGame' took 0.0075419s
  Delete 2 directories took 0.0084909s
CleanMode.Clean() took 2.8372085s
Creating makefile for DungeonGameEditor (no existing makefile)
Building UnrealEditor - DungeonGameEditor - Win64 - DebugGame
Compiler: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\Hostx64\x64\cl.exe
Linker: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\Hostx64\x64\link.exe
Library Manager: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\Hostx64\x64\lib.exe
Resource Compiler: C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\rc.exe
Using EngineIncludeOrderVersion.Unreal5_0 for target DungeonGameEditor.Target.cs
UnrealHeaderTool needs to run because UnrealHeaderTool timestamp (05/30/2025 16:46:51) is later than timestamp for module DungeonGame (05/30/2025 16:45:34)
Parsing headers for DungeonGameEditor
  Running Internal UnrealHeaderTool C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\DungeonGame.uproject C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Intermediate\Build\Win64\DungeonGameEditor\DebugGame\DungeonGameEditor.uhtmanifest -WarningsAsErrors -installed
C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Source\DungeonGame\DGAttributeSet.h(47): Warning: The identifier 'GENERATED_BODY' was detected in a block being skipped. Was this intentional?
Total of 0 written
Total execution time: 4.17 seconds
CompilationResultException: Error: OtherCompilationError
   at UnrealBuildTool.ExternalExecution.ExecuteHeaderToolIfNecessaryInternalAsync(BuildConfiguration BuildConfiguration, FileReference ProjectFile, TargetMakefile Makefile, String TargetName, ISourceFileWorkingSet WorkingSet, ILogger Logger) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\System\ExternalExecution.cs:line 1150
   at UnrealBuildTool.ExternalExecution.ExecuteHeaderToolIfNecessaryAsync(BuildConfiguration BuildConfiguration, FileReference ProjectFile, TargetMakefile Makefile, String TargetName, ISourceFileWorkingSet WorkingSet, ILogger Logger) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\System\ExternalExecution.cs:line 909
   at UnrealBuildTool.UEBuildTarget.BuildAsync(BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, TargetDescriptor TargetDescriptor, ILogger Logger, Boolean bInitOnly) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildTarget.cs:line 2529
   at UnrealBuildTool.BuildMode.CreateMakefileAsync(BuildConfiguration BuildConfiguration, TargetDescriptor TargetDescriptor, ISourceFileWorkingSet WorkingSet, ILogger Logger) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 1130
   at UnrealBuildTool.BuildMode.BuildAsync(List`1 TargetDescriptors, BuildConfiguration BuildConfiguration, ISourceFileWorkingSet WorkingSet, BuildOptions Options, FileReference WriteOutdatedActionsFile, ILogger Logger, Boolean bSkipPreBuildTargets) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 396
   at UnrealBuildTool.BuildMode.ExecuteAsync(CommandLineArguments Arguments, ILogger Logger) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\Modes\BuildMode.cs:line 252
   at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in C:\Program Files\Epic Games\UE_5.3\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 659
WriteFileIfChanged() wrote 0 changed files of 0 requested writes.
Timeline:

[ 0.000]
[ 0.000](+4.185) <unknown>
[ 4.185]

I didn’t copy code from ChatGPT, just used it to try and solve this problem. I did notice a warning about inconsistent line endings whenever I opened a file in VS. I normalized them however.

UE is not open. Can’t load the project into UE until the modules are built.

I’ve noticed if I comment out the #define statement above the UCLASS(), the GENERATED_BODY() is no longer skipped but I get a bunch of other errors.

Thank you for the extended log, the conflict comes from the following section, related to GENERATED_BODY, as you mentioned in your latest post:

C:\Users\kfpop\Documents\pkhLineworks\DungeonGame\Source\DungeonGame\DGAttributeSet.h(47): Warning: The identifier ‘GENERATED_BODY’ was detected in a block being skipped. Was this intentional?
Total of 0 written
Total execution time: 4.17 seconds
CompilationResultException: Error: OtherCompilationError

Somewhere in your code, that element was being skipped, and failing the entire compilation. Since you have already fix the skip, but the issue persists, please re-generate your project files from DungeonGame.uproject, then try to compile again.

If the issue remains, then we will need the updated logs, with the new errors.

Sorry I wasn’t clear. The other errors I was getting were because the attribute getter and setter weren’t defined by the macro anymore. All I did was this:

// Uses macros from AttributeSet.h

//#define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \
//
//	GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
//
//	GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \
//
//	GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \
//
//	GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName)

Today I replaced these macros manually with the code and it compiled fine.

Here are the macros from the AttributeSet.h file:

#define GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
	static FGameplayAttribute Get##PropertyName##Attribute() \
	{ \
		static FProperty* Prop = FindFieldChecked<FProperty>(ClassName::StaticClass(), GET_MEMBER_NAME_CHECKED(ClassName, PropertyName)); \
		return Prop; \
	}

#define GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \
	FORCEINLINE float Get##PropertyName() const \
	{ \
		return PropertyName.GetCurrentValue(); \
	}

#define GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \
	FORCEINLINE void Set##PropertyName(float NewVal) \
	{ \
		UAbilitySystemComponent* AbilityComp = GetOwningAbilitySystemComponent(); \
		if (ensure(AbilityComp)) \
		{ \
			AbilityComp->SetNumericAttributeBase(Get##PropertyName##Attribute(), NewVal); \
		}; \
	}

#define GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName) \
	FORCEINLINE void Init##PropertyName(float NewVal) \
	{ \
		PropertyName.SetBaseValue(NewVal); \
		PropertyName.SetCurrentValue(NewVal); \
	}

I just replaced the macros with this code for each attribute and it compiled fine:

/** Current Mana, used to execute special abilities. Capped by MaxMana */

UPROPERTY(BlueprintReadOnly, Category = "Abilities", ReplicatedUsing = OnRep_Mana)

FGameplayAttributeData Mana;

//ATTRIBUTE_ACCESSORS(UDGAttributeSet, Mana)

static FGameplayAttribute GetManaAttribute()
{
	static FProperty* Prop = FindFieldChecked<FProperty>(UDGAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED(UDGAttributeSet, Mana));
	return Prop;
}


FORCEINLINE float GetMana() const
{
	return Mana.GetCurrentValue();
}


FORCEINLINE void SetMana(float NewVal)
{
	UAbilitySystemComponent* AbilityComp = GetOwningAbilitySystemComponent();
	if (ensure(AbilityComp))
	{
		AbilityComp->SetNumericAttributeBase(GetManaAttribute(), NewVal);
	};
}


FORCEINLINE void InitMana(float NewVal)
{
	Mana.SetBaseValue(NewVal);
	Mana.SetCurrentValue(NewVal);
}

I’m just not sure why it went wrong. All these macros are autogenerated by UE.