I haven't coded something this complex in C++ before and I haven't had time to really review. I'm making a game (well, foundations for a game anyway), with an external game library, Allegro. But I think the problems I'm having is more fundamental to C++ in general. Included is a .zip of my program but I'm curious how I should utilize the following: The code has a main and 2 headers. Both are meant to be objects. One object controls a player on the screen, specifically its behaviors. The other controls the animation itself. I don't see a need to have the player header
player > animator > main
program9handler: player
p9animationhandler: animator
program9rev1: main
Its explained more clearly here:
but I'm having linkage errors with the animator:
Im compiling using g++ on mac 10.5.8
jdd:allegro-4.2.2 jasondancks$ g++ /users/jasondancks/Desktop/allegrostuff/program/program9rev1.cpp -o /users/jasondancks/Desktop/allegrostuff/program/p9rev `allegro-config --libs`
Undefined symbols:
"p9animationhandler::setmargin(int)", referenced from:
_mangled_main() in ccO9Z6xX.o
"p9animationhandler::~p9animationhandler()", referenced from:
___tcf_0 in ccO9Z6xX.o
"p9animationhandler::animate()", referenced from:
draw() in ccO9Z6xX.o
"p9animationhandler::go()", referenced from:
_mangled_main() in ccO9Z6xX.o
"p9animationhandler::stop()", referenced from:
_mangled_main() in ccO9Z6xX.o
"p9animationhandler::setbitmaps(BITMAP*)", referenced from:
_mangled_main() in ccO9Z6xX.o
"p9animationhandler::setdelay(int)", referenced from:
_mangled_main() in ccO9Z6xX.o
"p9animationhandler::turnleft()", referenced from:
_mangled_main() in ccO9Z6xX.o
"p9animationhandler::reverse()", referenced from:
_mangled_main() in ccO9Z6xX.o
"p9animationhandler::setuptanks()", referenced from:
_mangled_main() in ccO9Z6xX.o
"p9animationhandler::draw()", referenced from:
draw() in ccO9Z6xX.o
"p9animationhandler::turnright()", referenced from:
_mangled_main() in ccO9Z6xX.o
"p9animationhandler::p9animationhandler()", referenced from:
__static_initialization_and_destruction_0(int, int)in ccO9Z6xX.o