Fixing Build Errors

For each build, PWB keeps a complete list of build errors and messages in the Build Results window. The ANNUITY1.C program that you just built contains several errors that you'll identify and fix in this section.

·To go to the first error:

From the Project menu, choose Next Error, or press SHIFT+F3.

PWB positions the cursor on the location of the first error or warning in your program; in this case, the keyword int is misspelled. The message from the compiler is displayed on the last line of the window.

Whenever a message is displayed on the bottom line of the window, you can get Help on that message by clicking the Help button on the status bar or by pressing F1.

·To get Help on a message that is not currently displayed:

1.Press ALT+A. This executes the PWB function Arg to begin a text argument.

2.Type the error number with its alphabetic prefix. In this example it would be C2065. For the C and C++ compiler, be sure to use the exact letter case of the message number.

3.Press F1.

When you use one of these techniques to get Help on the message, PWB opens the Help window and displays information about the error.

When you are finished reading the Help, close the Help window by clicking the close box in the upper-left corner of the Help window, by pressing ESC, or by pressing CTRL+F4.

Correct the first error by changing ont to int.

The compiler reports two additional errors that are side effects of the misspelling of int. You could continue choosing Next Error to skip these additional messages, but there is another way to go directly to a selected error in Build Results.

·To go to a selected error:

1.From the Window menu, open the PWB Windows cascaded menu and choose Build Results.

PWB opens the Build Results window, which contains the complete results of the build.

2.Find the next message that is not a side effect of the first error, and move the cursor to that line in the Build Results window.

Move the cursor to the message:

error C2001: newline in constant.

3.From the Project menu, choose Goto Error.

PWB jumps to the location of the second error in the program.

Correct the second error in the program (an unterminated string) by adding the missing double quotation mark (") one space beyond the colon (:) in the prompt string.