Click to See Complete Forum and Search --> : Any other AP CompSci students here?


Gaccm
03-25-2002, 08:43 PM
cause i need some help.

I'm trying to compile the marine biology case study but i can't.
I've dumped all the fish simulation files into a single dir, but it just wont compile. I try running the command "g++ fishsim.cpp apstring.cpp" but i get these weird undefined references:

/tmp/ccxNYKaq.o: In function `main':
/tmp/ccxNYKaq.o(.text+0x41): undefined reference to `Environment::Environment(is
tream &)'
/tmp/ccxNYKaq.o(.text+0x53): undefined reference to `Display: :Display(void)'
/tmp/ccxNYKaq.o(.text+0x77): undefined reference to `Simulation::Simulation(void
)'
/tmp/ccxNYKaq.o(.text+0x90): undefined reference to `Display::Show(Environment c
onst &)'
/tmp/ccxNYKaq.o(.text+0x135): undefined reference to `Simulation::Step(Environme
nt &)'
/tmp/ccxNYKaq.o(.text+0x14e): undefined reference to `Display::Show(Environment
const &)'

anyone know what i'm doing wrong?

[ 25 March 2002: Message edited by: Gaccm ]

recluse.
03-26-2002, 02:41 PM
Did you include the appropriate header files?

Stuka
03-26-2002, 02:42 PM
I'm no AP comp sci student, but it looks like you're missing a C++ source file. Those are linker errors - you're missing a file with the function definitions, or else you aren't linking in a library you need.

Disc0stoo
03-28-2002, 06:41 PM
AP CS was the stupidest class I ever took. I can't believe they're still making people do that marine biology bull****. Make sure you link ALL the files together that need to be linked, when I did it it was on Borland TC++, and I just made a project file. You can't just link those 2 together, you have to link EVERY source file in there, because they all depend on each other.

Gaccm
03-28-2002, 09:18 PM
i never got it to work with g++, but am now using kdevelop and it works fine.

TheBouleOfFools
03-29-2002, 10:40 PM
omg I'm in AP Prog and we have to do the marine biology crap it sux soooo bad.

s3raphim
03-31-2002, 06:42 PM
i know rants are the other forum but apcs is soooo useless. but on the other hand, you're missing some of the includes. watchout for bool.h errors too, that can get nasty.
it looks to me like you're missing display.h and cpp, and environment.h and cpp. also maybe you have ref'd something that isn't ref'd in the header file, that too could make it not recognize the function. also missing semi-colons, the files we got in class were very buggy.