Addressing Compilation Errors

If your Helloworld program was error-free, you saw how the IDE informed you of the status of your successful compilation: a message appeared in the status bar at the bottom of the screen.

Let's introduce an error to see how the IDE will handle it:

Place the cursor in your editor, or Source pane and click into this line:

cout << "Hello World" << endl;

Change the semicolon (;) at the end of the line to a colon (:).

Now try rebuilding. Click the Build button .

This time, two things happen:

1. The status line at the bottom of the screen displays a message:

Last Compile terminated with errors on [date] in [time]

2. The page displayed has changed.

You now have the Messages page displayed.

On this page, the top pane lists the errors that were encountered during the rebuild, with a short description of each. The bottom pane shows your source code and has highlighted the point where the error occurred:

 

Place the cursor into this line and replace the semicolon.

Rebuild by clicking the build button again. It's that simple!