2 classes breaking my program

I have a UE4 project that won’t open in the past few days. It crashes on startup and I am unable to do anything in it. I’m desperate so here is my full, unaltered log. I have two classes, Starship and GameManager that are causing issues apparently, according to the log. In the definitions of the classes, the GENERATED_BODY() macro has “no storage class or type specifier” and the engine “cannot open” the generated headers, according to VS. However, none of my other classes have these issues. If there is anything else I can send for help, I’ll gladly send it. This might be a UE4 issue, not sure. I have tried: compiling without any of my src in the source folder but still project outputs exact same log, deleting saved and intermediate, regenerating visual studio files, rebuilding, building, and cleaning. However, I duplicated my project through the library and IT DID OPEN TO THE EDITOR, but was in a mangled state with many assets missing.

I’ve had questions up for months that never get answered, so really anything can help. Im lost.

First of all download debugging symbols (PDB) as i don’t see engine call stack, you should have it in installation option in installed, they very useful inf you use C++ and it hard to debug without them. I only know your code is involved in crash as it shows in call stack (PDB for you code is generated when you compile it) more specificly constructors from your classes, engine also prints out the cause of it, so yes always look in logs when you get crash, solution is sometimes there:

"[2018.07.03-19.06.15:620][  0]LogWindows: Error: UObject() constructor called but it's not the object that's currently being constructed with NewObject. Maybe you are trying to construct it on the stack, which is not supported.

Constructor of any UObject (this includes AActors which are also UObjects) class is called on module load on engine start up during creation of Class Default Object (CDO) which stores default values, this means if there something goes wrong in constructor the engine will on start up. Just by looking on call stack there something od in your costructor:

[2018.07.03-19.06.15:620][  0]LogWindows: Error: [Callstack] 0x00000000EAD82280 UE4Editor-CoreUObject.dll!UnknownFunction []
[2018.07.03-19.06.15:620][  0]LogWindows: Error: [Callstack] 0x00000000D9858CEE UE4Editor-Engine.dll!UnknownFunction []
[2018.07.03-19.06.15:620][  0]LogWindows: Error: [Callstack] 0x00000000C12C7AEF UE4Editor-Star_Cataclysm-1026.dll!AStarship::AStarship() [c:\users\\onedrive\documents\unreal projects\star_cataclysm\source\star_cataclysm\starship.cpp:8]
[2018.07.03-19.06.15:620][  0]LogWindows: Error: [Callstack] 0x00000000C12C22BF UE4Editor-Star_Cataclysm-1026.dll!AGameManager::AGameManager() [c:\users\\onedrive\documents\unreal projects\star_cataclysm\source\star_cataclysm\gamemanager.cpp:7]
[2018.07.03-19.06.15:620][  0]LogWindows: Error: [Callstack] 0x00000000EAB454F8 UE4Editor-CoreUObject.dll!UnknownFunction []
[2018.07.03-19.06.15:620][  0]LogWindows: Error: [Callstack] 0x00000000EADD7D30 UE4Editor-CoreUObject.dll!UnknownFunction []
[2018.07.03-19.06.15:620][  0]LogWindows: Error: [Callstack] 0x00000000EADB94A2 UE4Editor-CoreUObject.dll!UnknownFunction []

Call stack suggest that AGameManager costructor is calling AStarship costructor for some reason, like you trying to create AStarship inside AGameManager constrictor which is something that should not happen there. Due to nature of UObjects and UE4 reflection system, special use of constructors in UObject and mentioned CDO creation, constructors of UObject should not have any gameplay code and should only set default variables and/or set up components. Constructors are called in early initiation of the engine and object/actor it self and not everything is initiated during that point, which means most things you gonna try to do there most likely will crash, instead you should use events that UObjects and actors provide, it allows to inject code on most of most initiation steps some of them are described there:

PostInitializeComponents (runs also in editor) and BeginPlay (runs only in gameplay) are the safest spots as everything should work on that point.

Error message quated on top also suggest whatever you doing to create the actor you doing it wrong, actors should be only created with ActorSpawn and UObjects with NewObject and you should not do that in constructor because it gonna mess up CDO.

Thats all i could deduced from what you gave, for more you need to get those debug symbols and code snippets of both AStarship and AGameManager cpp and h files, aspecially constructors ofcorse

link text

so I actually did find an issue in my gamemanager constructor with me trying to make a starship in it, but it is gone now. However, the issue still subsists.heres a zip of all of the starship and gamemanager files in their current state. As I said, I found the problematic code and removed it. If you can find anything else that could be causing this, I’m all ears. Just tell me what’s next.

then you got old bineries, delete your dlls in bineries forder

thanks for the help. fixed my issues.