It is really annowying. Forget a semi-colon and spend 2 hours on debugging because the error message is “Failed to generate code” instead of telling you “Expected ‘;’ before whatever”, like it is by default in C++ programming…
Hi Marron, I’m sorry this has caused you trouble. Unfortunately, even though we try hard, we’re probably never going to be able to make UnrealHeaderTool is robust as any C++ compiler. However, I’d like to hear more about your case. Can you post the code that caused this failure? We’ll try to add code to UnrealHeaderTool to handle this case with a meaningful message.
Sorry, I can’t post the code, but it is like this: My code just didn’t want to build, and the error I got is “Failed to generate code”, and the problem in my code was that I forgot a “;” symbol. Try it yourself. Go to some code you wrote and delete a semi-colon, and see what error you get. I tried it and I still got the same error if I remove a semi-colon. What I wanted to say is that error messages are not helpful. Thanks for your attention.
Ok, we’ll try it on our end. Thanks.
Hi Marron,
as Robert said, we fix such issues on case by case basis. I analyzed couple of our headers and removed semicolons in various places. I found one case which wasn’t handled properly and committed fix for that in CL#2260578. If that doesn’t help - could you try to reproduce your problem in UE4 codebase so we have exact reproduction of your problem?
Thanks,
Mikolaj