<<

How To Compile, Link and Debug -Programs Using the Open Watcom

1) Start the IDE (Integrated Development Environment) from the Windows

menu.

2) Select /New Project and enter appropriate project path/name

(Warning: the integrated editor of the IDE has some problems with long Windows filenames containing spaces. Use a simpler path like “c:\Projects” instead!)

Select Win32 target environment and -mode ! IMPORTANT!

3) Select Sources/New Source and add your c-source file. You can either specify an existing file or just an appropriate name. In the latter case the file will be tagged as “n/a” (= not available) in the IDE project window.

4) Double-click the source file name in the IDE project window to invoke the integrated editor and write the . Our test program should just count from 1 to 10:

5) Save your source code and close the editor.

6) Select Targets/ or simply press F4 to compile and link the program. And yes, you should read the output in the IDE log window! It is not wise to ignore compiler warnings!

7) Start your program by selecting Targets/Run or press Ctrl-.

8) To invoke the debugger, select Targets/Debug or press Ctrl-. This cannot be a comprehensive survey over the wonderful world of symbolic . Nevertheless, the most essential features of this (like any) debugger are:

a) Single step execution: Step over functions or Trace into ) /clear breakpoints c) Add/delete watches d) Restart program ) Execute to next breakpoint

Restart program

Execute

Step over

Trace into

Toggle breakpoint

Local variables

Right-click here to set/clear watch points