This section describes how to use Microsoft Visual C++ compilers to compile programs that use Rogue Wave's DBTools.h++ class library.
Here are some examples of the commands used to compile a file called myapp.cpp.
NOTE: These examples do not include any linking directives.
cl -Ic:\rwav\workspaces\WINNT4\MSVC60\7s -nologo -GX -D"WIN32" -D_DEBUG -DRWDEBUG -D"NOMINMAX"-c myapp.cpp
cl -I c:\rwav\workspaces\WINNT4\MSVC60\4d -nologo -GX -D"WIN32" -D"NOMINMAX" -DRWDLL -c myapp.cpp
The -I option tells the compiler where to find the Rogue Wave header files.
In the dynamic build, RWDLL is a macro that must be defined for DLL builds.
In the DEBUG build, the macro RWDEBUG must be defined.
To build a program that uses DBTools.h++ under the Microsoft Visual Studio development environment, you must add the Rogue Wave include path, such as <rw_root>\workspaces\WINNT<ver>\MSVC<ver>\<buildtype>, to your studio configuration. Use the menu selection Tools | Options... to bring up the options dialog. Select the Directories tab, select Include Files from the Show Directories For: drop-down box, and add the necessary include paths.
You will also need to define any macros and compiler switches required to use a particular configuration of the DBTools.h++ and Tools.h++ products.
See the Microsoft Visual Studio help system for instructions on making changes to a project configuration.
Before starting, be sure that the Microsoft environment variables PATH, INCLUDE, and LIB are set to the proper search path for the Microsoft compiler, the system #include header files, and the libraries, respectively.
When you are using a static library:
You must link the libraries shown in Table 14 and the database-specific objects and libraries shown in Table 15 with your DBTools.h++ application.
You must link the required DBTools.h++ object module, also shown in Table 15. This module is in charge of notifying the RWDBManager that a corresponding access library must be reached through a static link, rather than through runtime binding. Object modules follow the naming convention:
rw<libtype><buildtype>.<extension>
where <libtype> is the three-letter mnemonic for the access library as explained in Table 6, <buildtype> encodes the build type as explained in Table 9, and <extension> is the operating system object file extension, either .o for UNIX systems or .obj for PC systems.
In Table 14 and Table 15, the files marked with an asterisk (*) are located in <rw_root>\workspaces\<OS+ver>\MSVC<ver>\<buildtype>\lib. Chapter 2 explains how to interpret this path.
Objects/Libraries | Description |
*\dbt#s.lib |
DBTools.h++ core library. |
*\tls#s.lib |
Tools.h++ library. |
Database | Objects/Libraries | Description |
Informix |
*\rwinf#s.obj |
Required DBTools.h++ object module. |
Informix |
*\inf#s.lib |
DBTools.h++ access library. |
Informix |
<INFORMIX>\LIB\iclit<ver>.lib For example, <INFORMIX>\LIB\iclit09b.lib |
Import library supplied by Informix, where <ver> is the version of your Informix installation. |
MS SQL Server |
*\rwmsq#s.obj |
Required DBTools.h++ object module. |
MS SQL Server |
*\msq#s.lib |
DBTools.h++ access library. |
MS SQL Server |
<SQLSERVER>\lib\odbc32.lib |
Import library supplied by Microsoft. |
DB2 CLI |
*\rwdb2#s.obj |
Required DBTools.h++ object module. |
DB2 CLI |
*\db2#s.lib |
DBTools.h++ access library. |
DB2 CLI |
<DB2PATH>\lib\ <client_lib_name>.lib |
Import library supplied by IBM for DB2 CLI, for example, db2cli.lib. |
ODBC |
*\rwodb#s.obj |
Required DBTools.h++ object module. |
ODBC |
*\odb#s.lib |
DBTools.h++ access library for ODBC. |
ODBC |
<ODBC>\lib\ <client_library_name>.lib |
Import library supplied by Microsoft or ODBC driver vendor, for example, odbc32.lib. |
Oracle |
*\rwora#s.obj |
Required DBTools.h++ object module. |
Oracle |
*\ora#s.lib |
DBTools.h++ access library. |
Oracle |
<ORACLE>\oci73\lib\msvc\ociw32.lib or <ORACLE>\oci80\lib\msvc\ociw32.lib or <ORACLE>\oci\lib\msvc\oci.lib |
Import library supplied by Oracle for Oracle OCI library. |
Oracle8 |
*\rwor8#s.obj |
Required DBTools.h++ object module. |
Oracle8 |
*\or8#s.lib |
DBTools.h++ access library. |
Oracle8 |
<ORACLE>\oci\lib\msvc\oci.lib |
Import library supplied by Oracle for Oracle OCI library. |
Sybase CT Library |
*\rwctl#s.obj |
Required DBTools.h++ object module. |
Sybase CT Library |
*\ctl#s.lib |
DBTools.h++ access library. |
Sybase CT Library |
<SYBASE>\lib\ <client_library_name>.lib |
Import libraries supplied by Sybase for Client-Library, libct.lib, libcs.lib, and libblk.lib. |
1 | For dynamic builds, change #s to #d in the library name and remove the object module from the list of required files. |
Microsoft Visual C++ allows you to create a DBTools.h++ DLL under Windows 95 and Windows NT. To use the 32-bit DLL version of DBTools.h++, you must:
Use the Microsoft runtime DLL or the debugging version of the Microsoft runtime DLL for debugging builds.
Use the DLL version of Tools.h++.
Define the macro RWDLL on the compiler command line.
Define RWDEBUG and _DEBUG for debugging builds of the libraries.
Link your program with the import libraries listed in Table 16, but not an import library for a DBTools.h++ access library DLL; the binding is made at runtime. In addition, when binding occurs at runtime, all interaction with the database server is through the access library DLL; therefore, it is not necessary to explicitly link with the database import libraries (or their wrappers) either.
In Table 16, files marked with an asterisk (*) are located in <rw_root>\workspaces\<OS+ver>\MSVC<ver>\<buildtype>\lib. Chapter 2 explains how to interpret this path.
Objects/Libraries | Description |
*\dbt#d.lib |
DBTools.h++ core library. |
*\tls#d.lib |
Tools.h++ library. |
When you run your program, the DBTools.h++ and Microsoft runtime library DLLs, and the database vendor libraries, must be in one of the following places:
the current directory
the \WINDOWS or \WINNT directory
the \WINDOWS\SYSTEM or \WINNT\SYSTEM32 directory
the directory containing the executable file for the current task
the directories listed in the PATH environment variable
the list of directories mapped in your network search paths
If you get exceptions, especially in *.DLLs, and you can't figure out where they're coming from, you may have incompatible *.DLLs running. Check for incompatible .DLLs in your path.
Be sure that you have established connectivity between your client and server machines. Ask your system administrator to help set up your computer for access to the servers.
If you are using a static library, supply the name of the database as the first parameter for the method RWDBManager::database(). If you are using a shared DBTools.h++ access library, supply the name of the DLL as the first parameter of the method RWDBManager::database(). Table 17 lists the database name, and an example DLL name for each supported database.
Database | Database name | Example DLL name |
Informix |
INFORMIX |
inf#d.dll |
DB2 CLI |
DB2CLI |
db2#d.dll |
MS SQL Server |
MS_SQL |
msq#d.dll |
ODBC |
ODBC |
odb#d.dll |
Oracle |
ORACLE |
ora#d.dll |
Oracle8 |
ORACLE8 |
or8#d.dll |
Sybase Client-Library |
SYBASE_CT |
ctl#d.dll |
Be sure that your PATH includes the location of your DLLs. Also be certain that you do not have "extra" versions of any relevant DLLs in your PATH. In Windows 95, set PATH in the autoexec.bat file. In Windows NT, set the path through the System Registry (the System icon in the Control Panel).
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.