c++ compile error "redefinition of", need help to find it
it's a long time that I don't use C++ and I'm not so friendly with it. I'm resuming an old project of mine and trying to compile it, but I get the following error output launching Makefile:
g++ -W -ggdb3 -Wall -ansi -pedantic -c main.cpp
In file included from Entity3d.h:4,
from SceneManager.h:10,
from main.cpp:5:
Entity.h:82: warning: unused parameter ‘rot’
Entity.h:82: warning: unused parameter ‘delta’
Entity.h:82: warning: unused parameter ‘scale’
In file included from SceneManager.h:20,
from main.cpp:5:
GamePlayer.h:52: error: redefinition of ‘Vector3d delta’
GamePlayer.h:52: error: ‘Vector3d delta’ previously declared here
main.cpp:7: warning: second argument of ‘int main(int, char*)’ should be ‘char **’
make: *** [main.o] Error 1
Where GamePlayer.h:52 is:
void Behavior(Vector3d rot, Vector3d delta, Vector3d delta);
Behavior override a function of it's parent class (Entity.h):
virtual void Behavior(Vector3d rot, Vector3d delta, Vector3d scale) {};
The hier开发者_JAVA技巧archy of classes is the following:
class GamePlayer : public Entity3d
class Entity3d : public Entity
I checked the include guards and it seems to be correct.
Can anyone put me in the right direction?
You've used the same name for two parameters:
... Vector3d delta, Vector3d delta);
精彩评论