Hi all, I've been assigned some homework (I know but keep reading) which requires me to alter a little game written by my instructor. unfortunately I cant compile it to begin with! I'm running OS X 10.4.11 can anyone give me any insight into why those gcc commands might not work?????
Run the game consisting of the following nine files, but don’t hand it in. To compile term.h, and term.c, see the Homework 1.7.3a instructions for Unix and Bloodshed.
1. term.h and term.c (in the language C). See Chapter 1, pp. 85–89.
2. terminal.h and terminal.C. See Chapter 2, pp. 157–163.
3. rabbit.h and rabbit.C. See Chapter 2, pp. 192–200.
4. wolf.h and wolf.C
5. main.C
Instructions for compiling
1$ gcc -I. -DUNIX= -c term.c //Create the object fileterm.o.
2$ ls -l term.o // minus lowercase L
3$ g++ -I. -o ̃/bin/tester main.C term.o -lcurses
4$ ls -l ̃/bin/tester
5$ tester // Run it; but first makesureyour terminal is set tovt100,bitansi.
You should probably start building yourself a Makefile to automate the build process.
You have funky characters in your build string: "g++ -I. -o \314\203~/bin/tester"
You are trying to do too many things at once. Try this one step and see if it works:
g++ -I. -o main.o main.cpp
then...
g++ -I. -oterminal.o terminal.cpp
do that for every cpp file.
Once that is done, link all of the object files and executables:
g++ -o tester main.o terminal.o ... -lcurses Note the ellipses -- you need to replace my ellipses with all object files you built in the previous steps.