I can't figure out what the actual problem is with this.
typedef struct _actor
} _actor, Actor;
actor.cpp:31: error: using typedef-name ‘Actor’ after ‘class’
You are not allowed to define the symbol
Actor more than once. The
typedef statement already defines the symbol
Actor as an alias for
struct _actor before you attempt to declare a class with the same name.
I'm guessing you're using the
gcc compiler. I get the following errors when I compile with
../src/main.cpp:113: error: using typedef-name ‘Actor’ after ‘class’ ../src/main.cpp:111: error: ‘Actor’ has a previous declaration here
The first message (pointing the
class Actor line in the program) states that you cannot declare a class with a
Actor is already declared using
typedef). The second message (pointing to the
typedef struct _actor line in the program) is a little clearer and refers to the multiple declarations for
It is very common in C/C++ for a single class of error like this to result in multiple compiler errors and often the more helpful message is not the first reported.