22.02.2014 Views

with DOS/4GW? - Open Watcom

with DOS/4GW? - Open Watcom

with DOS/4GW? - Open Watcom

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>DOS</strong> Programming Guide<br />

3.2 Building and Running the Sample<br />

386|<strong>DOS</strong>-Extender Application<br />

To compile and link our example program which is stored in the file HELLO.C, enter the<br />

following command:<br />

C>wcl386 /l=pharlap hello.c<br />

The typical messages that appear on the screen are shown in the following illustration.<br />

C>wcl386 /l=pharlap hello.c<br />

WATCOM C/C++32 Compile and Link Utility<br />

Copyright by WATCOM International Corp. 1988, 2000. All rights reserved.<br />

WATCOM is a trademark of Sybase, Inc. and its subsidiaries.<br />

wcc386 hello.c<br />

WATCOM C32 Optimizing Compiler<br />

Copyright by WATCOM International Corp. 1984, 2000. All rights reserved.<br />

WATCOM is a trademark of Sybase, Inc. and its subsidiaries.<br />

hello.c: 6 lines, included 174, 0 warnings, 0 errors<br />

Code size: 24<br />

WATCOM Linker<br />

Copyright by WATCOM International Corp. 1985, 2000. All rights reserved.<br />

WATCOM is a trademark of Sybase, Inc. and its subsidiaries.<br />

loading object files<br />

searching libraries<br />

creating a Phar Lap simple executable<br />

Provided that no errors were encountered during the compile or link phases, the "hello"<br />

program may now be run.<br />

C>run386 hello<br />

Hello world<br />

If you examine the current directory, you will find that two files have been created. These are<br />

HELLO.OBJ (the result of compiling HELLO.C) and HELLO.EXP (the result of linking<br />

HELLO.OBJ <strong>with</strong> the appropriate <strong>Watcom</strong> C/C++ libraries). It is HELLO.EXP that is run by<br />

<strong>DOS</strong> when you enter the "run386 hello" command.<br />

12 Building and Running the Sample 386|<strong>DOS</strong>-Extender Application

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!