Compiling and Linking for Windows NT and Windows 95

You can compile and link precompiled Embedded SQL programs for Windows NT and Windows 95 on a computer that is running the Windows NT or Windows 95 operating system by using the Visual C++ development system (32-bit) version 2.0.

Before you compile an Embedded SQL program for Windows NT or Windows 95, set the LIB environment variable to include the full path where the following library files are located:

For example:


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

To compile and link a program for Windows NT and Windows 95

1. Run the compiler CL.EXE as you would for Windows NT or Windows 95 to create an object file. For example:


CL /c /W3 /D"_X86_" MYPROGRM.C

In this example, the compiler creates the object file MYPROGRM.OBJ. The /D"_X86_" compiler option defines the symbol that is necessary for Windows NT and Windows 95 operating systems that run on Intel®-based computers. You can use any additional compiler options that are allowed by the compiler.

2. Run the linker (LINK.EXE) as you would for Windows NT or Windows 95 to link the compiled Embedded SQL object file and system libraries, which creates an executable file for Windows NTor Windows 95. When linking files for Windows NT –based or Windows 95–based programs, you must explicitly link with the SQLAKW32.LIB and CAW32.LIB libraries. For example:


LINK /NOD /subsystem:windows MYPROGRM.OBJ MYPROGRM.RES KERNEL32.LIB GDI32.LIB USER32.LIB LIBCMT.LIB SQLAKW32.LIB CAW32.LIB

In the example, the compiled object file MYPROGRM.OBJ, the system libraries, and the Embedded SQL libraries SQLAKW32.LIB and CAW32.LIB are linked together to create the executable file MYPROGRM.EXE for Windows NT or Windows 95.

To run a Windows NT–based or Windows 95–based Embedded SQL application, the dynamic-link libraries SQLAKW32.DLL, NTWDBLIB.DLL, and DBNMPNTW.DLL (or other appropriate Net-Library) must be available in your path.