There are several implementations of ODBC for Unix, but only unixODBC has been tested with the project.
ODBC support is included in many distributions. It is possible to:
- Use ODBC libraries and header files from the distribution; or
- Download, build and install the unixODBC project; or
- Download the unixODBC project in order to get the header files, but use the ODBC libraries from the distribution.
Building the client library requires the standard ODBC headers: sql.h, sqlext.h and sqltypes.h. Building the ODBC driver requires the additional header file sqlucode.h. Building the ODBC driver and the setup library needs libodbcinst.so. The ODBC Driver Manager libodbc.so is used by the client library at runtime only.
The project contains a driver setup library that is designed specifically for unixODBC. It is a plug-in for ODBCConfig, the GUI utility for Driver and Data Source configuration. Building this library needs odbcinst.h and odbcinstext.h headers.
To obtain the ODBC header files:
- Download unixODBC from http://www.unixodbc.org
-
Unpack it to a directory located next to $(SQL_ROOT) and rename the directory to unixODBC.
If the unixODBC root directory is located and/or named differently, the configuration must be changed. Specify the path to the unixODBC directory relative to $(SQL_ROOT) among the parameters of the project (see Building the project on Unix).
If ODBC libraries are not available from another source:
- Build the unixODBC project according to the description. It is important to specify --sysconfdir=/etc among configure parameters, otherwise the ODBC libraries will look for ini files in a non-standard locations.
- do
make install
in the build directory in order to put the libraries into the proper location.
Avoid combining ODBC libraries from the distribution and from your own build. Differences in configure parameters may cause a malfunction.