I recently decided that it would be a good idea to create my own plugin for personal use between different projects I have planned. I have only ever dealt with Blueprints so far in unreal, but I wanted to branch out into C++ to try and expand what is possible.
Inside of my plugin, i knew that i was going to be using a lot of Enumerations, so I figured I would take this as an opportunity to learn some C++. I have recently been looking through some source code for other plugins i own, so try to piece some things together, and I noticed that in one plugin, they were simply using a .h file to store all of the Enums they needed.
I created a C++ file in my plugin public source folder and gave it an appropriate name, and then proceeded to follow the format that i could see from the reference Enum .h file I had been looking at.
My issue is that my project builds perfectly fine, and when i open the unreal editor, my Enums are available to use in blueprints. But in Visual studio, almost all of my code is showing errors.
This is the code that i have (it has a few more enums, but i removed them just to keep the length down. Also, the file that i was using as a reference also has “#include <CoreMinimal.h>” inside of it before the generated.h include, but that just added an extra like 500 more errors, so i removed it and it still seemed to build just fine.
#pragma once
#include "HC_LevelEditor_Enums.generated.h"
//Reset Types
UENUM(BlueprintType)
enum class EResetType : uint8
{
LevelReset,
CheckpointReset
};
//Distance Operations
UENUM(BlueprintType)
enum class EDistanceOperations : uint8
{
World,
Plane,
Height
};
The main error seems to be from the “#include “HC_LevelEditor_Enums.generated.h”” as it says “cannot open source file “HC_LevelEditor_Enums.generated.h””
After that, basically everything else is just throwing an error:
Also just in case its important, here is a pic of my file structure also:
I appreciate any help that can be given, thanks! <3