Rogue Wave banner
Previous fileTop of DocumentContentsNext file

4.6 Compiling in Windows with MSVC

This section describes how to use Microsoft Visual C++ compilers to compile programs that use Rogue Wave's Tools.h++ class library.

4.6.1 Using a Static Version of Tools.h++ (MSVC)

Before starting, be sure that the Microsoft environment variables INCLUDE and LIB are set to the proper search path for the system #include header files and the libraries, respectively.

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 our Tools.h++ header files are located in c:\rwav\workspaces\WINNT4\MSVC60\4s, and that we built static version of Tools.h++ named tls4s.lib. Then we can compile myapp.cpp with the Microsoft C++ compiler with the following command (all on one line):

This command will compile and link in one step.


NOTE: Even if you are compiling a Tools.h++ Windows NT or Windows 95 console program, you still need to link in the user32.lib library, because Tools.h++ uses the Windows message box to report errors.

4.6.2 Using a Dynamic Version of Tools.h++ (MSVC)

Microsoft Visual C++ allows you to create a Tools.h++ DLL 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:

  1. Define the macros _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.

  2. Use the -MD option on the compiler command line, to use the DLL version of Microsoft's runtime library.

  3. Link your program with the Tools.h++ import libraries. The names of the import libraries are:

  4. When you run your program, it will search for the Tools.h++ DLL and the DLL version of Microsoft's runtime library in one of the following places and in the following order:

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.

4.6.3 Compiling from Microsoft Visual Studio

To build a program that uses Tools.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 Tools.h++ library.

See the Microsoft Visual Studio help system for instructions on making changes to a project configuration.


Previous fileTop of DocumentContentsNext file

©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.