Unknown access specifier for generated_body

I am getting an error that says

Error: static assertion failed with “Uknown access specifier for Generated_BODY() macro in class WeapLauncher”

There are no other errors in the c++ script or header, just this one line.

#pragma once

#include "GameFramework/Actor.h"
#include "WeapLauncher.generated.h"


USTRUCT()
struct FWeaponData
{
	GENERATED_USTRUCT_BODY()

	UPROPERTY(EditDefaultsOnly, Category = Ammo)
	int32 MaxAmmo;

	UPROPERTY(EditDefaultsOnly, Category = Config)
	float TimeBetweenShots;

	UPROPERTY(EditDefaultsOnly, Category = Config)
	float WeaponRange;

};

UCLASS()
class HAUNTED_API AWeapLauncher : public AActor
{
	// private:
	GENERATED_BODY()

	UFUNCTION()
	void Fire();

	UPROPERTY(EditDefaultsOnly, Category = Config)
	FWeaponData WeaponConfig;
	

public:

	// Sets default values for this actor's properties
	AWeapLauncher(const class FObjectInitializer& ObjectInitializer);

	// Set Components
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Collision)
	class UBoxComponent* CollisionComp;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Config)
	class USkeletalMeshComponent* WeaponMesh;

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

};

Hello, _cDub

I am sorry to hear about your issue.
In this situation, please make sure that WeapLauncher.generated.h contains the following lines:

#define GENERATED_BODY() \
PRAGMA_DISABLE_DEPRECATION_WARNINGS \
public: \
	AWeapLauncher_RPC_WRAPPERS_NO_PURE_DECLS \
	AWeapLauncher_CALLBACK_WRAPPERS \
	AWeapLauncher_INCLASS_NO_PURE_DECLS \
	AWeapLauncher_ENHANCED_CONSTRUCTORS \
private: \
PRAGMA_POP

You can find WeapLauncher.generated.h in Haunted\Intermediate\Build\Win64\Inc\Haunted\ folder.

Also, please make sure that the Engine (Unreal Header Tool in particular) is working correctly. To do this, you can rebuild UE4 from source, which can be downloaded from GitHub (if you like to learn more, please go here:
Unreal Engine on GitHub - Unreal Engine)

Hope this helped!

Have a great day!

It partially looks like that:

#define GENERATED_BODY() \
PRAGMA_DISABLE_DEPRECATION_WARNINGS \
public: \
	AWeapLauncher_RPC_WRAPPERS_NO_PURE_DECLS \
	AWeapLauncher_CALLBACK_WRAPPERS \
	AWeapLauncher_INCLASS_NO_PURE_DECLS \
	AWeapLauncher_ENHANCED_CONSTRUCTORS \
static_assert(false, "Unknown access specifier for GENERATED_BODY() macro in class WeapLauncher."); \
PRAGMA_POP