Reputation: 21
As far as I could find out, C++ is not recognising my Unit class. I am sure I included it correctly in my GameMaster.h . I tried forward declaring but it had no effect. It seems to be linked correctly with makefile. Where could the error lie?
GameMaster.cpp:21:34: error: expected primary-expression before ‘*’ token
if (combatHandler.isEnemies(Unit* attackingUnit, Unit* defendingUnit))
code:
if (combatHandler.isEnemies(Unit* attackingUnit, Unit* defendingUnit))
Upvotes: 0
Views: 784
Reputation: 92211
When you are calling the functions, you should not give the parameter types, just their values. Perhaps like this
if (combatHandler.isEnemies(&attackingUnit, &defendingUnit))
Upvotes: 4