How to Compile, Link and Debug C-Programs Using the Open Watcom Compiler
Total Page:16
File Type:pdf, Size:1020Kb
How To Compile, Link and Debug C-Programs Using the Open Watcom Compiler 1) Start the IDE (Integrated Development Environment) from the Windows menu. 2) Select File/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 Character-mode Executable! 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 source code. Our test program should just count from 1 to 10: 5) Save your source code and close the editor. 6) Select Targets/Make 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-R. 8) To invoke the debugger, select Targets/Debug or press Ctrl-D. This cannot be a comprehensive survey over the wonderful world of symbolic debugging. Nevertheless, the most essential features of this (like any) debugger are: a) Single step execution: Step over functions or Trace into b) Set/clear breakpoints c) Add/delete watches d) Restart program e) Execute to next breakpoint Restart program Execute Step over Trace into Toggle breakpoint Local variables Right-click here to set/clear watch points .