After taking a break for several weeks I have to hurry and hand in my work in a few days ^^.
So if you could answer this one rather quickly I’d be thankful Now let’s see… I’m trying to implement the enemy named goombas (from supermario) which is a derived class from SDLGameObject. I’m getting the following error:
C:\ C++ & SDL2\Super Mario Time Trip\Goombas.cpp|5|undefined reference to `vtable for CGoombas'|
It’s a little confusing since I’m using the exact same method as in the Player-class. I’m not getting an error there. I know there’ve been some other question just like this but I wouldn’t post here if I’d understood them…
Here’s some actual code: (I’ve cut out the in my eyes unnecessary parts)
Here's a tip: Only store data as a string if it's text that's manipulated by the program. A state doesn't have to be a string. It should be an enumeration.
Actual solution:
Have you tried changing the variables in the base class from private to protected? http://ideone.com/CxUTKZ
@Avilius:
Ill memorise that The variables already where protected, I typed in the private myself because I couldn’t copy everything. Some dumb error of mine ;)
The change from a string to an enumeration (wtf why did I ever take a string haha ^^’) is scheduled as well. Your help is very appreciated!
@Peter:
Hm and where did I miss out on the definition? :s
Something similar is already on google, but I don’t see an obvious error.
Alright I've fixed it. The error wasn't in the code i posted before at all. I've deleted a few arguments in a function of my goombas class. It's just funny that codeblocks was pointing me to the constructor and not the function itself...