Using SoftBench

Building Projects and Targets

Interpreting Error Messages

The error messages displayed in the output browser depend on the compiler you are using. The messages always contain a line number, indicating the point in your source code where the compiler detected the error. The file name may be on the same line or on a previous line in the error output. An error message indicates the problem the compiler found. For more information on compiler errors, refer to "Help: Language Reference" and your appropriate language.

Error messages may not point to the actual error. For example, if you forget to declare a variable in a C program, the C compiler indicates the first use of the variable with the message:

cc: 'filename', line number: error errnum: name undefined.

To fix this problem, you may need to declare the variable earlier in the file, or perhaps in another file. You get the same message if name is misspelled; in that case, the compiler finds the actual error location, and the error is easy to fix.

After the first error in a location, the compiler sometimes produces misleading errors. Subsequent errors may be a ripple effect from the first error. You may want to fix the earlier errors, then build again.

Browsing and Correcting Build Errors

You can double-click on the errors in the output browser to view and edit the related source code. The editor opens with the source file loaded and the cursor at the beginning of the line where the error was detected.

Alternatively, you can browse the compile errors using the error browsing buttons. Select First to select the first error in the output browser and go to the related source file in the editor. If you have write access to the file, you can edit the source, correcting problems as you browse.

Select Next, Previous, or Last, or double-click on other errors in the output browser, to display and correct other compile errors. If you have scrolled the window to where the currently highlighted error is no longer visible, select Selected to see it again. When all your errors have been corrected, save your file from the editor, and rebuild your project to make sure it builds successfully.

The output browser has a popup menu and pulldown menu available from "Builder: Browser" submenu with additional features to help you handle your errors:

74

Chapter 2

Page 74
Image 74
HP UX SoftBench Software manual Interpreting Error Messages, Browsing and Correcting Build Errors