Missing '{' in 'struct'

After declaring multiple structs in separate files I got this error out of blue:

 Missing '{' in 'struct'

and

- error code: OtherCompilationError (5)

Previously it all compiled fine. If I remove that last added file with struct exactly same error start to point to other struct in my project. I double checked and I HAVE that curly bracket in next line. I’m using inheritance from my base struct type and implementing interface in this particular struct.

Error points to line where keyword struct is defined and expect to have it there (the curly bracket which is in next line). Does not make any difference if I move curly bracket to end of that particular line.

Regeneration VS project does not help either. I’m 100% positive I do not have typo anywhere, all brackets in place and I’m using proper USTRUCT, UPROPERTY etc tags. Does anyone else got this error?

I’m very curious what might happen as I did nothing except add new struct that is using interface. Now I’m unable to continue as project won’t compile.

Any pointers to what might be wrong are more than welcome!

I have seen similar problems in a friend’s code.
You should try cutting out all the code that throws the errors and saving it elswehere until your code compiles, then systematically adding it back in.
When I did this I was able to find several lines of whitespace near commented code that was throwing all sorts of strange errors, but when deleted fixed the problem.
Good luck hunting your issue down.

Thank you very much for suggestion @Spiris I will try this approach… Indeed it might very well be case… I’ll let you know.

Hey Vertex Soup,

Let us know if this approach works for you. If you are still experiencing errors after this and are unable to determine what is causing the issue, please provide the full code that you are using when you are experiencing this error, or a simplified test project that we can take a look at to get a closer look at what exactly is happening in your code.

Have a great day!

For now it look like @Spiris was right, I deleted temporary code that was added prior it stopping work and get to point where it compiled without error, then I reintroduced code back but this time made sure I deleted all spaces and end line characters and typed them all back. I was unable to trace why this happened and if it will not pop up in couple next days again I’ll mark it as resolved. Fingers crossed. :slight_smile:

Must have been some invisible character causing trouble… Marked as answered.

In my case problem was that I accidentally used russian character “С” instead of english “C” in struct name. Took awhile to realize.