How to Build with PWB

This section outlines the basic steps needed to build a program using PWB. For further information about using PWB, see the PWB Tutorial in Environment and Tools.

·To build your example program with PWB, do the following:

1.Run PWB.

If you are running Windows, start PWB from the Program Manager.

If you are running PWB from DOS or from a DOS command shell in Windows, type PWB at the command line.

2.From the Project menu, choose the Open Project command.

This command displays a dialog box of the same name in which you can name your project and select a makefile for the project.

3.Select the .MAK file for your program and click the OK button.

Use the following makefiles for the tutorial examples:

For DMTEST, Chapter 2, use DMTEST.MAK.

For HELLO, Chapter 3, use HELLO.MAK.

For PHBOOK, Chapters 4 through 6, use PHBOOK.MAK.

For CMDBOOK, Chapter 4, use CMDBOOK.MAK.

For the locations of these makefiles, see “Makefile Locations” on page 8.

4.From the Options menu, choose the Build Options command. The Build Options dialog box appears. Confirm that “Use Release Options” is set. This is the default provided in the tutorial's makefiles.

Note:

The makefiles for the tutorial examples build release versions by default. To see how this default setup looks in PWB, choose some of the options commands in the PWB Options menu and examine the dialog boxes to see which options are selected.

5.To compile, from the Project menu, choose the Build command.

The Build command on the menu now includes your project name, for example, “Build: DMTEST.exe.”

6.When the build finishes, the Build Results dialog box will appear, showing how many errors and warnings occurred. If there were no errors, click the Cancel button in the dialog box.

If you're compiling a DOS program and running PWB under DOS or Windows, you can instead click the Run Program button in the dialog box. This executes the program from PWB. If you're compiling for Windows, see “How to Run Your Program” on page 13.

7.If you get errors, do one of the following:

After building a DOS program from the Build menu, choose Debug to locate the source of the error. For more details, see your documentation for PWB in Environment and Tools.

After building a Windows program, switch to the Windows Program Manager and run the Codeview debugger. See your Windows documentation for more information.