YALE UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE
| CPSC 223b: Data Structures and Programming Techniques | Handout #2 | |
| Professor M. J. Fischer | January 17, 2008 | |
Problem Set 1
Due before midnight on Tuesday, January 22, 2008.
Congratulations on your purchase of Wisdom! software. Built to the highest standards of quality, your satisfaction is assured.
Some assembly is required before use. Please follow these simple instructions and your product will give you a lifetime of satisfaction.
Parts List You should find the following listed parts in the Zoo course directory:
Do not continue if these files cannot be located or if you do not have a Zoo account. Assembly can only be performed on the Zoo. A Windows or Mac machine cannot be used for this purpose.
Tools Required You will need to use the following tools:
Assembly Overview In assembling your Wisdom! software, use emacs to create a command source file wisdom.c. Apply gcc in compile mode to wisdom.c and the furnished pearls.h to produce the command object file wisdom.o. Carefully mix together wisdom.o with pearls.o using gcc in link mode. Give your executable command the name wisdom. Type wisdom at a shell prompt to get Wise!
Detailed Assembly Instructions
| -c | Puts gcc into compile mode. |
| -o wisdom.o | Specifies the name of the object module to be created by the compiler. |
| -std=c99 | Tells the compiler to accept the C99 dialect of C that we will be using in this course. |
| -pedantic | Says not to accept language extensions not provided by the C99 standard. |
| -Wall | Tells the compiler to warn of possible source code errors. |
| -I path | Tells the compiler an additional place to look for header files. |
| -g | Says to include the symbol table for later use by the debugger |
| -O1 | Tells the compiler to use optimization level 1 |
For the path argument to the -I switch, you need to specify the directory that contains the header file pearls.h, which is in /c/cs223/assignments/ps1. It should be used from there and not copied to your course directory.
If you get any warnings from the compiler, go back to step 1, correct the error in the source code, and repeat step 2.
| -o wisdom | Specifies the name of the executable command file to be created by the linker. |
In addition to the -o option, you will need to give gcc as command line arguments the names of the two compiled object files to be linked together: wisdom.o and pearls.o. Because pearls.o is not in your working directory, you will need to give its full path name /c/cs223/assignments/ps1/pearls.o
Satisfaction Guarantee Our operators are on duty 7 days a week to help you with any problems you may encounter. Go to the bottom of the course web page for contact information and help desk hours.