Compiling and Linking for QuickWin

Embedded SQL for C and SQL Server

Embedded SQL for C and SQL Server

Compiling and Linking for QuickWin

QuickWin is a set of libraries that helps convert source code for Microsoft®
MS-DOS® into 16-bit Microsoft Windows®-based applications. You can compile and link precompiled ESQL/C programs for QuickWin on a computer that is running the MS-DOS or 16-bit Windows operating system by using the Microsoft Visual C++® development system (16-bit), version 1.52.

Microsoft® SQL Server™ version 7.0 does not supply the environment for compiling ESQL/C 16-bit MS-DOS or 16-bit Windows clients (the 16-bit binaries for Windows and MS-DOS are not included). However, these clients will run under SQL Server 7.0. To compile an ESQL/C 16-bit MS-DOS or 16-bit Windows client, you need to use the ESQL/C compilation environment in SQL Server 6.0 or 6.5, which includes the 16-bit binaries.

ESQL/C sources can be built as either large or medium memory model 16-bit Windows, QuickWin executables.

You can set the LIB environment variable to avoid specifying library paths for the ESQL/C libraries, for example:

SET LIB= C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Lib;C:\MSVC\LIB

The following libraries are supplied and used by ESQL/C for C programs when built as 16-bit Windows, QuickWin executable files:

  • Caw.lib

  • Sqlakw.lib

To compile and link a program for QuickWin

  1. Run the compiler Cl.exe as you would for 16-bit Windows to create an object file, for example:
    CL /c /W3 /AM MYPROGRM.C

    In the example, the compiler creates the object file Myprogrm.obj. The /AM compiler option sets the memory model of the program to medium. You can use any additional compiler options allowed by the compiler.

  2. Run the linker Link.exe as you would for 16-bit Windows to link the compiled ESQL/C object file and system libraries, which creates an executable file for Windows. When linking files for Windows-based programs, you must explicitly link with the Sqlakw.lib and Caw.lib libraries, for example:

    In the example, the compiled object file Myprogrm.obj, system libraries Libw.lib and Mlibcewq.lib, and ESQL/C libraries Sqlakw.lib and Caw.lib are linked together to create the executable file Myprogrm.exe for Windows.

To run a 16-bit Windows-based ESQL/C application, the dynamic-link libraries Sqlakw.dll, Msdblib3.dll, and Dbnmp3.dll (or other appropriate Net-Library) must be available in your path.