UMBC CMSC 201
CSEE | 201 | 201 F'06 | lectures | news | help
If debugging is the process of removing bugs,
then programming must be the process of putting them in...
We've talked about a little already about how to use printf() statements to debug your programs, and by now all of you realize that it usually takes more time to debug a program than it does to write it.
The good news is, as you gain more experience you'll make fewer logic and syntax errors. You'll also get better at debugging your own code.
The bad news is, it's going to take a lot of experience.
Today we're going to discuss some basic debugging techniques, including the use of a symbolic debugger to help you find and fix errors in your code.
The compiler identifies several kinds of errors:
Linker errors tend to be simple and are usually caused be forgetting to include an object file or failing to define a function in one of them.
% gcc -Wall -ansi proj3.o students.o proj3.o: In function `main': proj3.o(.text+0x121): undefined reference to `CalculateStats' collect2: ld returned 1 exit status %
Tuesday, 22-Aug-2006 07:14:17 EDT