Reputation: 1
I am getting a very strange compile error pointing to where I declare a pointer to my class.
MyClass* myClass; //Line 34
Error:
MyFile.h|34|error: ISO C++ forbids declaration of ‘MyClass’ with no type
MyFilee.h|34|error: expected ‘;’ before ‘*’ token
I could not get a clue what is going wrong. Could anyone throw some light.
Upvotes: 0
Views: 355
Reputation: 99535
Seems to be declaration of MyClass
is not visible at that point. Compiler considers MyClass
as a new variable's name without type specified.
Upvotes: 2