Compiling and Linking for MS-DOS

You can compile and link precompiled Embedded SQL programs for MS-DOS on a computer that is running the MS-DOS version 6.22 or later operating system by using the Visual C++ development system (16-bit) version 1.52 or later.

Before you compile an Embedded SQL program for MS-DOS, set the LIB environment variable to include the full path where the following library files are located:

For example:


SET LIB=C:\MSVCNT\LIB;C:\MSSQL\ESQL\LIB

To compile and link a program for MS-DOS

1. Run the compiler CL.EXE as you would for MS-DOS to create an object file. For example:


CL /c /W3 /AL MYPROGRM.C

In the example, the compiler creates the object file MYPROGRM.OBJ. The /AL compiler option sets the memory model of the program to large. You can use any additional compiler options that are allowed by the compiler.

2. Run the linker LINK.EXE as you would for MS-DOS to link the compiled Embedded SQL object file and system libraries which creates an executable file for MS-DOS. When linking files for MS-DOS–based programs, you must explicitly link with the SQLAKD.LIB, RLDBLIB.LIB, OLDNAMES.LIB and CAR.LIB libraries. For example:


LINK /NOD MYPROGRM.OBJ,,, LLIBCE.LIB SQLAKD.LIB CAR.LIB OLDNAMES.LIB RLDBLIB.LIB, MYPROGRM.DEF;

In the example, the compiled object file MYPROGRM.OBJ, the system library LLIBCE.LIB, the Embedded SQL libraries SQLAKD.LIB, CAR.LIB, and OLDNAMES.LIB and the DB-Library library RLDBLIB.LIB are linked together to create the executable file MYPROGRM.EXE for MS-DOS.

To run an MS-DOS–based Embedded SQL application, load the appropriate Net-Library TSR.