Hello, I’m new to c++. I’m a blueprint programmer. Now I’m trying to convert my blueprint project into c++. But I have got a lot of errors at startup. When I am creating enum with none c++ class then write this code it’s given me a lot of error. Please Check my code And help me. I want to make an enum Library. but it’s not working.
#pragma once
#include "CoreMinimal.h"
#include "MRSEnumLibrary.generated.h"
UENUM(BlueprintType)
enum class EGait : uint8
{
Walking,
Running,
Sprinting,
};
Since MRSagor949 is new to C++, I just provided a quick easy example of using an enum with blueprints.
@MRSagor949 I tested your code (with the extra comma) and it compiles and executes fine. Can you provide what the exact error you’re receiving is? I have a suspicion something else is causing your problem.
Looking at uproperty specifiers, I don’t see BlueprintType as an option. I’m not sure where that came from, and it looks like that type is undefined (see the second error in your file).
Once that’s fixed, I suspect it will generate a “.generated.h” for you. I know it will generate one if your header has a UCLASS or a USTRUCT. It may not for just UENUMS, though.
If you’re still having the error, try commenting-out that include.
A lot of thanks to you. I have found the solution. there must include a cpp file, After compile complete then we can delete the CPP file. otherwise, it will give you these types of errors.