Compiling and Linking Applications with SQLAPI++
To build and run a program that interfaces with a database using SQLAPI++ you need the following components of the library:
- Header file(s)
- Link-time library
- Run-time library (optionally)
Header files - Compile time
Developers need to include SQLAPI++ header files into their source files. Those with a command-line compiler will typically use options such as /I%SQLAPIDIR%\include
or -I${SQLAPIDIR}/include
. The header files are in the include subdirectory of SQLAPI++ distributions.
#include <SQLAPI.h>
This is the main header of the library. Most of the time this is the only header that you need to write code with SQLAPI++. Classes in this header provide unified access to every supported database.
Access to Native API
Occasionally, you may need to use a very specific feature available only for given database. In that case you need to also include one of the additional headers to be able to leverage server-specific APIs.
For more information about server specific headers and APIs, see Server Specific Guides.
Static or dynamic libraries - Link time
Developers need to link with static or dynamic libraries. Those with a command-line compiler will typically use options such as /L%SQLAPIDIR%\lib sqlapi.lib
or -L${SQLAPIDIR}/lib -lsqlapi
.
The libraries are in the lib subdirectory of SQLAPI++ distributions:
Windows
sqlapi.lib
- for linking with release version of dynamic library (MS Visual Studio C++)sqlapid.lib
- for linking with debug version of dynamic library (MS Visual Studio C++)sqlapis.lib
- for linking with release version of static library (MS Visual Studio C++)sqlapisd.lib
- for linking with debug version of static library (MS Visual Studio C++)sqlapib.lib
- for linking with release version of dynamic library (Borland C++)sqlapibd.lib
- for linking with debug version of dynamic library (Borland C++)sqlapibs.lib
- for linking with release version of static library (Borland C++)sqlapibsd.lib
- for linking with debug version of static library (Borland C++)libsqlapidll.a
- for linking with release version of dynamic library (MinGW)libsqlapiddll.a
- for linking with debug version of dynamic library (MinGW)libsqlapi.a
- for linking with release version of static library (MinGW)libsqlapid.a
- for linking with debug version of static library (MinGW)
Linux/Unix
libsqlapi.so
- for linking with release version of dynamic library (GNU C and C++ project compiler)libsqlapid.so
- for linking with debug version of dynamic library (GNU C and C++ project compiler)libsqlapi.a
- for linking with release version of static library (GNU C and C++ project compiler)libsqlapid.a
- for linking with debug version of static library (GNU C and C++ project compiler)
Unicode Libraries
Dynamic Link Libraries (DLLs) - Run time
Users of programs built with the dynamic SQLAPI++ libraries need those same dynamic libraries to run the programs. The DLLs are in the bin subdirectory of SQLAPI++ distributions:
Windows
sqlapi.dll
- release version of dynamic library compiled with MS Visual Studio C++sqlapid.dll
- debug version of dynamic library compiled MS Visual Studio C++sqlapib.dll
- release library compiled with Borland C++sqlapibd.dll
- debug library compiled with Borland C++libsqlapi.dll
- release library compiled with MinGWlibsqlapid.dll
- debug library compiled with MinGW
Linux/Unix
libsqlapi.so
- for programs linked with the release version of dynamic librarylibsqlapid.so
- for programs linked with the debug version of dynamic library