You swapped the arguments of your typedef - it's
typedef {{type}} {{typename}}
, so your typedef should be
typedef struct {
...
} myStruct;
This didn't cause the error, but if the typedef for
testStruct
looks the same, the compiler didn't get it, and therefore didn't recognize that name as a type name.
P.S.: of course there is no need for a typedef in C++ in this case (or ANSI C for that matter): you can just write:
struct myStruct {
...
};
and can then use it as you would a typedef:
void foo() {
myStruct s;
}