This section describes how to use UNIX compilers to compile programs that use Rogue Wave's DBTools.h++ class library.
Aside from entering the appropriate compiler name, there are no special command line options that must be set to compile an application. For example to compile myapp.cpp, use the appropriate version of the following command, specifying the proper operating system and compiler in the path you provide. The command must be typed all on one line.
CC -c -I<rw_root>/workspaces/<OPSYS+ver>/<COMPILER+ver>/<buildtype> myapp.cpp
NOTE: On Linux, the C++ compiler invocation is g++.
This section describes special considerations you should be aware of when linking DBTools.h++ in UNIX.
To build a DBTools.h++ application, you must always link with the DBTools.h++ core library and the Tools.h++ library.
If your DBTools.h++ access library was built as a shared library, you do not link your application with it. Binding to the access library is done by the DBTools.h++ application at runtime, orchestrated by the RWDBManager.
If, on the other hand, your DBTools.h++ access library was built as a static library, you must link your application with both the access library and your target database libraries. You must also link in the appropriate object module for your DBTools.h++ access library, located in the <rw_root>/workspaces/<OPSYS+ver>/<COMPILER+ver>/<buildtype>/lib directory. The name of each access library object module appears in Table 18. This module is in charge of notifying the RWDBManager that a corresponding access library is to be reached via a static link, rather than through runtime binding.
With most UNIX linkers, link order is important. Table 18 describes the libraries for each database in the order that they should normally be linked.
Database | Objects/Libraries |
Informix |
DBTools.h++ access object, if using static libraries (for example, ../lib/rwinf<buildtype>.o) DBTools.h++ access libraries, if using static libraries (for example, -linf#s) DBTools.h++ core library (for example, -ldbt#s) Tools.h++ library (for example, -ltls#s) Vendor-supplied libraries if using static libraries (for example, -lthcli, etc.) System libraries (for example, -lnsl -ldl) |
DB2 CLI |
DBTools.h++ access object, if using static libraries (for example, ../lib/rwdb2<buildtype>.o) DBTools.h++ access libraries, if using static libraries (for example, -ldb2#s) DBTools.h++ core library (for example, -ldbt#s) Tools.h++ library (for example, -ltls#s) Vendor-supplied libraries if using static libraries (for example, -ldb2) System libraries (for example, -lnsl -ldl) |
ODBC |
DBTools.h++ access object, if using static libraries (for example, ../lib/rwodb<buildtype>.o) DBTools.h++ access libraries, if using static libraries (for example, -llibodb#s) DBTools.h++ core library (for example, -ldbt#s) Tools.h++ library (for example, -ltls#s) Vendor-supplied libraries if using static libraries (for example, -lodbc) System libraries (for example, -lnsl -ldl) |
Oracle |
DBTools.h++ access object, if using static libraries (for example, ../lib/rwora<buildtype>.o) DBTools.h++ access libraries, if using static libraries (for example, -lora#s) DBTools.h++ core library (for example, -ldbt#s) Tools.h++ library (for example, -ltls#s) Vendor-supplied libraries if using static libraries (for example, -loci., etc.) System libraries (for example, -lnsl -ldl) |
Oracle8 |
DBTools.h++ access object, if using static libraries (for example, ../lib/rwor8<buildtype>.o) DBTools.h++ access libraries, if using static libraries (for example, -lor8#s) DBTools.h++ core library (for example, -ldbt#s) Tools.h++ library (for example, -ltls#s) Vendor-supplied libraries if using static libraries (for example, -loci., etc.) System libraries (for example, -lnsl -ldl) |
Sybase Client-Library |
DBTools.h++ access object, if using static libraries (for example, ../lib/rwctl<buildtype>.o) DBTools.h++ access libraries, if using static libraries (for example, -lctl#s) DBTools.h++ core library (for example, -ldbt#s) Tools.h++ library (for example, -ltls#s) Vendor-supplied libraries if using static libraries (for example, -lct.) System libraries (for example, -lnsl -ldl) |
1 | For dynamic libraries, change #s to #d in the library and object names above. |
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.