Here are my errors:
1>------ Build started: Project: Dem Bones, Configuration: Release Win32 ------
1> skeleton.cpp
1>..\..\shell\shell\skeleton.cpp(45): error C2065: 'Player' : undeclared identifier
1>..\..\shell\shell\skeleton.cpp(45): error C2146: syntax error : missing ';' before identifier 'player'
1>..\..\shell\shell\skeleton.cpp(45): error C2065: 'player' : undeclared identifier
1> player.cpp
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Here's skeleton.cpp:
Here's player.cpp:
What is it I'm missing here?
Could you post player.h your error relates to C++ not recognizing Player class, so odds are it did not compile correctly (header).
Sure. Here's player.h:
Here's entity.h:
#pragma once #include<iostream> class Entity { public: virtual void Initialize() = 0; virtual void Update() = 0; virtual void Render() = 0; };
I don't know if it makes a difference in this case but could you try adding virtual to those 3 methods in Player?
virtual void Initialize(int x, int y, int velX, int velY, ALLEGRO_BITMAP* image[3]); virtual void Update(); virtual void Render();
I'm thinking maybe without the virtual, it does not register with the vtable and still considers Player as abstract.
Edit:
Looks like your way is correct http://www.tutorialspoint.com/cplusplus/cpp_interfaces.htm
Not sure what's wrong.
Yeah, it was saying it was abstract after I worked on it a bit, then I tried void virtual instead of virtual void without the = 0 at the end. That seemed to work. Thanks anyways!