This section describes how to use Borland's C++ compilers to compile programs that use Rogue Wave's Tools.h++ class library.
NOTE: If you are compiling VCL applications, be sure to read the Borland notes in toolread.doc.
These instructions assume that the Borland include files and libraries are in the locations specified by the file bcc32.cfg for 32-bit compiles. If not, you will have to specify -I and -L flags as well, or change your configuration file. (See the Borland User's Guide for instructions.)
Let's say that we have a file named myapp.cpp and that we are compiling it in a Windows NT MS-DOS command prompt. Let's also say that the Tools.h++ header file include path is c:\rwav\workspaces\WINNT4\BORLANDC++_Builder_40\4s, and that we have built a static, multithreaded version of Tools.h++ named tls4s.lib. Then we can compile myapp.cpp with the Borland C++ compiler with the following command (all on one line):
bcc32 -Ic:\rwav\workspaces\WINNT4\BORLANDC++_Builder_40\4s myapp.cpp c:\rwav\workspaces\WINNT4\BORLANDC++_Builder_40\4s\lib\tls4s.lib
This command will compile and link in one step.
The -I option tells the compiler where to find the header files.
If you are using Borland version 5.0.1 or earlier, you must also include the -Wm option, because Borland versions 5.0.1 and earlier default to single-threaded. Borland 5.0.2 defaults to multithreaded.
The path
c:\rwav\workspaces\WINNT4\BORLANDC++_Builder_30\4s\lib\tls4s.lib
is the full path name for a no standard library, no debugging, static Tools.h++ library for Borland C++. (Substitute as appropriate.)
Tools.h++ can be built as a DLL using Borland C++ under Windows 95 and Windows NT. Be sure to review the readme file for additional tips on using the DLL.
The dlldemo demonstration program is an example of using and linking with the DLL. It is in the <rw_root>\workspaces\<OS+ver>\<COMPILER+ver>\ <buildtype>\examples\tls<ver><osfam> directory. Additional tips on using the DLL are in the tooldll.doc readme file and in the Tools.h++ User's Guide section called "Dynamic Link Library."
To use the 32-bit DLL version of Tools.h++, you must:
Use the Borland runtime library (RTL) DLL.
Use the DLL version of Tools.h++.
Define the macro _RWTOOLSDLL and _RTLDLL on the compiler command line. This tells the Tools.h++ header files to configure for dynamic linking. If Tools.h++ is also using the Standard C++ Library, you must also define _RWSTDDLL.
Link your program with the Tools.h++ import libraries. The names of the import libraries are:
Release Version (no symbolic debugging or assertions):
Tools.h++: tls4d.lib
Borland runtime library: cw32mti.lib, import32.lib
Debug Version (with symbolic debugging and assertions):
Tools.h++: tls7d.lib
Borland runtime library: cw32imt.lib, import32.lib
The Tools.h++ DLL is tls<build#>d.dll. Section 2.4 explains build numbers. Check the Tools.h++ Build Guide for the name of the DLL file.
When you run your program, it will search for the Tools.h++ DLL and the Borland RTL DLL in one of the following places and in the following order:
the current directory
the \WINDOWS directory
the \WINDOWS\SYSTEM directory
the directory containing the executable file for your program
a directory listed in the PATH environment variable
the list of directories mapped in a network
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 the directories indicated above.
When using the Borland C++ IDE, you must define the Rogue Wave include path, for example, <rw_root>\workspaces\WINNT4\BORLANDC++_Builder_30\4s, to every project. Use menu selection Options | Project | Directories.
You should also add the appropriate Tools.h++ library to your Project Window. See the Borland User's Guide for instructions.
©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.