OTL 4.0, How to compile OTL
How to compile OTL
OTL 4.0 is an integrated library which contains instances of the same template
stream framework for the OCI7, OCI8, ODBC, and DB2 CLI. Let's refer to
the instances as OTL 4.0/OCI7, OTL 4.0/OCI8, OTL 4.0/ODBC, and OTL 4.0/DB2-CLI.
The following macro definitions (#define's) need to be used in order to
compile each instance:
-
OTL_ODBC (for ODBC)
-
OTL_ODBC_UNIX (for ODBC bridges in Unix)
-
OTL_ODBC_MYSQL (for MyODBC/MySQL).
The difference between OTL_ODBC_MYSQL and OTL_ODBC is that transactional
ODBC function calls are turned off for OTL_ODBC_MYSQL, since MySQL does
not have transactions
-
OTL_ORA7 (for OCI7)
-
OTL_ORA8 (for OCI8)
-
OTL_ORA8I (for OCI8 in the Oracle 8i environment)
-
OTL_DB2_CLI (for DB2
Call Level Interface (CLI))
-
OTL_ODBC_XTG_IBASE6 for Interbase
6.x via XTG Systems' ODBC
driver. The reason for introducing this #define is that the ODBC driver
is the only Open Source ODBC driver for Interbase. Other drivers, like
Easysoft's ODBC for Interbase, are commercial products, and it beats the
purpose of using Interbase, as an Open Source.database server.
-
OTL_ORA9I (for Oracle 9i). All code that
compiles and works under #define OTL_ORA7, OTL_ORA8, and OTL_ORA8I, should
work when OTL_ORA9I is used
-
OTL_ODBC_SQL_EXTENDED_FETCH_ON
(for ODBC and DB2-CLI). Forces OTL to generate calls to SQLExtendedFetch
(buffer size > 1), or SQLFetch (buffer size ==1), instead of SQLFetchScroll,
in case if the ODBC level is greater of equal to ODBC 3.0. This #define
is introduced to mainly fix a bug in DB2-CLI in Linux, and some ODBC drivers,
when CLOBs/BLOBs are being fetched with SQLFetchScroll().
There are several extra macro definitions which control compilation of
the OTL header file:
-
OTL_STL (for turning on std::strings,
and STL-compliant OTL stream iterators: otl_input_iterator, otl_output_iterator)
-
OTL_ANSI_CPP (for turning on ANSI C++ typecasts).
-
OTL_EXPLICIT_NAMESPACES (for
turning on namespaces)
-
OTL_STL_NOSTD_NAMESPACE (for
excluding namespace std, when #define OTL_STL is on). This is mainly for
fixing problem
42.
-
OTL_UNCAUGHT_EXCEPTION_ON
(for enabling a safer exception handling and error recovery). This is for
fixing problem 46.This #define only
works when #define OTL_STL is enabled.
-
OTL_EXTENDED_EXCEPTION (for
enabling the otl_exception's extended
fields for OTL/ODBC and OTL/DB2-CLI). This is for fixing problem 47.
-
OTL_STREAM_POOLING_ON (for enabling
otl_stream
pooling). This #define requires #define OTL_STL to be defined first
because STL containers were used in the implementation of the otl_stream
pooling. For more detail, see examples 113,
114,
115.
-
OTL_STLPORT (the same as #define OTL_STL,
only for use with STLPort 4.0). This #define makes OTL compile with STLPort
4.0. Most features of OTL, which require #define OTL_STL to be on,
compile with STLPort 4.0, except for otl_output_iterator,
otl_input_iterator
.
The reason is that in STLPort 4.0 the actual implementation of the stream
iterators is very different from the previous releases of STLPort and other
versions of STL available in commercial and free C++ compilers. Most probably,
I will implement the OTL stream iterators later.
-
OTL_VALUE_TEMPLATE_ON (for enabling
otl_value<T>).
The otl_value<T> template class can be also enabled with #define OTL_STL.
#define OTL_VALUE_TEMPLATE_ON allows the template class to be enabled without
turning on STL compliance. Not all C++ compilers compile OTL under #define
OTL_STL. #define OTL_VALUE_TEMPLATE_ON was introduced In order to relax
that limitation. Fore more detail, see examples 119,
120,
121
-
OTL_USER_DEFINED_STRING_CLASS_ON
(for
defining a string class, other than STL's std::string, for reading
from/writing to the otl_stream). This #define goes in pair with #define
USER_DEFINED_STRING_CLASS,
which is used to define the actual string class name.Fore more detail,
see examples 119,
120,
121
-
OTL_ACE (the same as #define OTL_STL,
only for use with Adaptive Communication Environment (ACE)).
This #defines makes OTL cmopile with ACE. Most features of OTL, which require
#define OTL_STL to be on, compile with ACE, except for otl_output_iterator,
otl_input_iterator.,
and the STL vector based PL/SQL table container
classes (otl_XXX_vec). OTL stream iterators were not implemented for
ACE since the concept of stream iterators is not present in ACE. Same with
with the otl_XXX_vec: vectors are not implemented in ACE. ACE has only
dynamic arrays with dynamically defined sizes.
Here is a fragment of the OTL 4.0 header file in which the macros are defined:
//======================= CONFIGURATION #DEFINEs ===========================
// Uncomment the following line in order to include the OTL for ODBC:
//#define OTL_ODBC
// Uncomment the following line in order to include the OTL for
// MySQL/MyODBC:
//#define OTL_ODBC_MYSQL
// Uncomment the following line in order to include the OTL for DB2
CLI:
//#define OTL_DB2_CLI
// Uncomment the following line in order to include the OTL for
// Oracle 7:
//#define OTL_ORA7
// Uncomment the following line in order to include the OTL for
// Oracle 8:
//#define OTL_ORA8
// Uncomment the following line in order to include the OTL for
// Oracle 8i:
//#define OTL_ORA8I
The macro definitions may be also turned on via C++ compiler command
line
option, e.g.: -DOTL_ODBC, -DOTL_ORA7, -DOTL_ORA8, -DOTL_ORA8I, -DOTL_ODBC_UNIX,
-DOTL_ODBC_MYSQL, -DOTL_DB2_CLI
In order to compile OTL 4.0/OCI7, the OCI7 object libraries as well
as the following OCI7 standard header files are needed:
-
ociapr.h
-
ocidfn.h
-
ocikpr.h
-
oratypes.h
The location of the header files and the libraries is specific to the operrating
system. See the Oracle 7 manuals for more detail.
In order to compile OTL 4.0/OCI8, the OCI8 object libraries as well
as the following OCI8 standard header files are needed:
-
nzerror.h
-
nzt.h
-
oci.h
-
ociap.h
-
ociapr.h
-
ocidef.h
-
ocidem.h
-
ocidfn.h
-
ociextp.h
-
ocikp.h
-
ocikpr.h
-
oratypes.h
-
ori.h
-
orid.h
-
orl.h
-
oro.h
-
ort.h
-
tnsapi.h
The location of the header files and the libraries is specific to the operating
system. See the Oracle 8 manuals for more detail.
In order to compile OTL 4.0/ODBC, the ODBC32 object libraries as well
as the following ODB32 standard header files are needed:
In order to compile OTL3.2/DB2-CLI, the DB2 CLI object libraries as well
as the following DB2/CLI header files are needed:
-
sqlcli1.h
-
sqlcli.h
-
all other header files, included into sqlcli1.h and sqlcli.h
For more detail, see the manul of the C++ environment that you are using.
Prev NextContentsGo
Home
Copyright © 1996, 2001, Sergei Kuchin, email: [email protected],
[email protected].
Permission to use, copy, modify and redistribute this document for
any purpose is hereby granted without fee, provided that the above copyright
notice appear in all copies.