Sometimes after a comparatively large modification of a UCLASS, I fail to compile the project. The compiler log is really simple. I’ve attached it below. This problem cannot be solved other than revert the whole project. I wonder why is this happening. The only thing that I know is that this error is related to the UCLASS definition. Unreal Header Tool cannot find my class.
This is not compiler error, this is UnrealHeaderTool crashing. UHT is a tool that parse UCLASS(), UPROPERTY() etc and generate extra code that register class and it’s elements to reflection system so engine see them exist (since when you compile C++ code all names and such are turn in to anonymous memory addresses, this is why this system exists for). When you remove UCLASS() you simply making UHT not to parse it at all, but UCLASS() and UHT generated code is required by UObject classes (this includes actors) as engine need to see them in order to manage them properly.
Since UHT don’t return specific error here you might hitting a bug here, can you paste how you declere that class that cause the, UCLASS() and first portion of it (but best would be whole class decleration)?
This is a screenshot of my project file, the problem cannot be solved even if I deleted all other c++ classes and comment all code that I have written. these are the only files that I have
Ok, so this happens only with AGameStateBase? Does this also happens when you have other thigns declered in class?
Also check few other things invidually:
-Remove RAYNETAB_TEST13_API
-Try GENERATED_UCLASS_BODY() insted of GENERATED_BODY() (this will require oyu to make a constructor with const FObjectInitializer& ObjectInitializer argument in cpp file
Hello! I ran into the same problem, but had a different cause.
I did the taboo thing of moving code around in the folder structure. When opening Unreal, it left a reference to the old code file in there, though it didn’t exist.
For anyone like me who is OCD about code file structure :P, make sure you delete your Binaries folder and re-generate your project files to remove that old code reference in Unreal.
After I did that, my code compiles again. Hope this helps someone out!