Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Blinker 5.10 Online Reference - <b> watcom c/c++</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Watcom C/C++
------------------------------------------------------------------------------
 Blinker supports version 8.0 and later of Watcom C/C++ for DOS real mode and
 Windows programs, and supports the 16 bit versions 10.0 and later for
 protected mode programs. The following sample programs written in Watcom
 C/C++ will be used throughout this section to illustrate the basics of
 linking Watcom C programs with Blinker.

 The DOSSEG command must always be specified in the link script file with
 Watcom C/C++. The run time error `Null assignment detected' usually
 indicates that this DOSSEG command has been omitted.
 Overlaid programs must be compiled to use far calls, i.e. medium, large or
 huge memory model. Extended and dual mode programs must be compiled to use
 large or huge memory model.

 Note that the file FP7WCCnn.OBJ MUST be explicitly linked in addition to
 BLXWCCnn.LIB when NO floating point emulation is required in a protected
 mode program, ie when compiling with options -fpc, -fpi87, -fp2 or -fpr.
 The Watcom resource compiler WRC requires the -zm option to output MS format
 16 bit resources which can then be used with the Blinker RC link script
 command. For 32 bit Windows programs WRC must be used for the second
 resource compiler pass, however, because Watcom uses a non standard 32 bit
 resource file format.

 TEST.C
 void limerick (void);
 void main (void)
 {
    limerick ();
 }
 LIMERICK.C
 <include <stdio.h>
 void limerick (void)
 {
    printf ("There was a young fellow from Watcom\n");
 }

 The two modules are compiled as large model code as follows :

 WCC -ml test.c
 WCC -ml limerick.c

 DOS extended / non-overlaid program

 # TEST.LNK (This is a comment)
 # Comment out the next line for DOS real mode program
 BLINKER EXECUTABLE EXTENDED   # Create DOS extended program
 DOSSEG                        # Required for Watcom C/C++
 FILE test
 FILE limerick
 SEARCH BLXWCCnn               # Blinker dual mode library
 MIXCASE                       # Make link case
 sensitive

 This causes Blinker to link the two object modules specified in the FILE
 commands (test.obj and limerick.obj) to create a DOS extended program with
 the name TEST.EXE, which is the name of the first .OBJ file in a FILE
 command.

 Dual mode / overlaid program

 # TESTDUAL.LNK
 # Comment out the next line for dynamic overlays only
 BLINKER EXECUTABLE DUAL       # Create dual mode program
 DOSSEG                        # Required for Watcom C/C++
 BLINKER OVERLAY OPSIZE 50     # 50kb overlay area
 BLINKER OVERLAY PAGEFRAME ON  # Run overlays in pageframe
 BLINKER MESSAGE WINK          # Only wink one eye
 FILE test                     # This file is not overlaid
 BEGINAREA                     # Start of overlays
    FILE limerick              # This file is overlaid
 ENDAREA                       # End of overlays
 SEARCH BLXWCCnn               # Blinker dual mode library
 OUTPUT t                      # Output .EXE name
 MAP A,S                       # Create MAP file
 MIXCASE                       # Make link case sensitive

 16 bit Windows program

 #TESTWIN.LNK
 DOSSEG            # Required for Watcom C/C++
 FILE test
 FILE limerick
 MIXCASE           # Make link case sensitive
 DEFFILE TEST      # Use TEST.DEF
 #TEST.DEF
 NAME         TEST
 DESCRIPTION  'A small Windows program'
 EXETYPE      WINDOWS 3.1
 HEAPSIZE     1024
 STACKSIZE    8192

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson