Errors from UCLASS() and constructor in C++ class


I have recently started programming c++ in Unreal Engine and stumbled upon some errors I cant solve. The code below gives errors from two separate lines.

#pragma once

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "Item.generated.h"

class CPPINVENTORY_API UItem : public UObject



	float Test;

The first error comes from the line UCLASS(UC::Abstract). Here the compiler gives me the error:

Error: Missing ‘,’ in Class
declaration declaration specifier
With some testing I found out that UCLASS(Abstract) works, however Abstract is then taken from the ‘ControlRigMetadata’ namespace instead of UC namespace. UCLASS() works as well but every time I try to add a property I wont compile.

The second error comes from the line UItem();. The compiler shows errors about some unresolved external symbol, and has the Code LINK2019 so there seems to be some linking problem.

Does someone have any clue why these errors occurs?

Does your UItem(); constructor has a body?

Hi, that solved the compile error for the constructor!

The error from the UCLASS macro is however still there.

UCLASS seems to work when I remove UC:: from the specifier. VS says the enum is taken from a file it should not be from but the code works as expected.