Handmade Hero»Forums»Code
55 posts
Unknown type name
Edited by elle on
I can't compile my game anymore. :S Compiler generates 10+ errors for unknown type names, although I import the header file in which the structs are declared. I've now tried 100 permutations of different import statements in different files but I don't know how to fix it.

Objective-c++ is a mess. And the error messages aren't helpful at all.

Can someone with Mac OS X tell me how they declare their structs?
typedef struct {} name; <> struct name {};
And how do you make the game_update_and_render function available to the platform? I want to throw my pc out of the window. :(

Edit: I'm sorry if I wasted anyone's time.

For future reference: The problem was that there was a circular dependency of the header files and this also caused the error messages to be nonsensical.
Mārtiņš Možeiko
2562 posts / 2 projects
Unknown type name
Edited by Mārtiņš Možeiko on
In C++ and Objective-C++ "typedef struct {} name" should give you exactly same behavior as "struct name {};" Only in C and Objective-C they are not the same.

You should start with exact error message and contents of file where it happens (what place, what includes/imports you have, etc..). There's no point of guessing it - otherwise you are wasting everyone's time.


And to be correct - you want to throw out your Apple computer, not PC :)