Greetings, I am having significant trouble diagnosing this error, as I simply don’t know what’s causing the problem and would greatly appreciate any insight.
Context: I am building a procedural generation script. Declared Enums as part of a separate Enums.h file (with an empty Enums.cpp, don’t know if that’s an issue), then I am attempting to call an enum called in that file “EBlock” in my new script, GreedyChunks.h.
Error: Before, I had it defined in Enums.h simply as “enum class EBlock”, no UENUM, no uint8. But then I needed to change it an UEnum to allow to be used in a UFunction. However, upon doing this, my call in GreedyChunks.h now doesn’t work.
"GreedyChunk.h(12): error C3433: ‘EBlock’: all declarations of an enumeration must have the same underlying type, was ‘unsigned char’ now ‘int’ "
Here is my Enums. h file, very short and simple:
And here is my current GreedyChunks.h layout, also short enough:
I have tried redefining EBlock outside of the struct, in a public declaration, using TEnumsAsBytes, and have rebuilt, cleaned, and deleted/regenerated the project files several times, always coming up with the same error which cascades everything else.
I reference EBlock a LOT in my code, since I’m not only using it to decide which block types go where, but also to feed in information during for loops while generating the mesh. I can change the name, the type, whatever is needed, but I don’t even know where to begin with this error and I’ve scoured the internet for references and fixes to no avail. While I understand coding quite well, I am still fairly new to C++ so I might be missing something obvious or otherwise unique to the syntax/structure. I just don’t know unfortunately.
Does anyone have any ideas, insight, or otherwise can help with this situation? It would be very appreciated.