Rogue Wave banner
Previous fileTop of DocumentContentsNext file

4.7 Compiling on Windows with MSVC

This section describes how to use the Microsoft Visual C++ compiler to compile programs that use Rogue Wave's Tools.h++ Professional class libraries.

If your application uses the Networking Module's int library and so requires the Threads.h++ library, be sure to read the section in the Threads.h++ Build Guide about compiling applications with MSVC.

4.7.1 Using a Static Version of Tools.h++ Professional

These instructions assume that the Microsoft environment variables INCLUDE and PATH are set to the proper search path for system header files and libraries, respectively.

Suppose that we have a file named myapp.cpp and that we are compiling it in a Windows NT MS-DOS command prompt. Suppose also that our Tools.h++, Tools.h++ Professional, and Threads.h++ (needed by the Networking Module's int library) header file include path is c:\rwav\workspaces\WINNT4\MSVC60\4s, and that we have built a static version of these three products. For an application that uses both libraries in the Java/C++ Interoperability Module and both libraries of the Networking Module, we could then compile myapp.cpp with the MSVC compiler using the following command (all on one line):


NOTE: If you are using the CORBA Module, remember to define the macros described in Section 4.6, "CORBA Module Considerations."

This command will compile and link in one step.


NOTE: Even if you compile a Windows NT or Windows 95 console program that uses Tools.h++ Professional, you still have to link in the user32.lib library. Tools.h++ uses it to report errors.

4.7.2 Using a Dynamic Version of Tools.h++ Professional

MSVC can build Tools.h++ Professional as a set of DLLs. To compile your application to use the DLL version of Tools.h++ Professional, do the following:

  1. Define the macro RWDLL on the compiler command line to configure the header files for dynamic linking.


  2. NOTE: If you are compiling your own DLL from code
    that contains the macro RWDEFINE_OPAQUE or the macro RWDEFINE_OPAQUE_COLLECTALBE macro, also define _RWORBSTREAMSBUILDCUSTOMDLL.

  3. Use the -MD or -MDd option on the compiler command line to use the release or debug version, respectively, of the Microsoft runtime library DLL. If your application uses Orbix, you must use -MD.

  4. Link your program with the import libraries for Tools.h++ and Tools.h++ Professional. The Tools.h++ Professional libraries to link to depends on the modules you are using.

  5. The names of the import libraries are:

    Section 2.6, "Build Types,", lists the possible values for <buildtype>.

    The path to the directory containing the import libraries is:

    <rw_root>\workspaces\<OS+ver>\<COMPILER+ver>\<buildtype>\lib

When you run your program, the DLLs for whatever import libraries you linked to in step 3 above, and the DLL version of Microsoft's runtime library, must be in one of the following places:

For Tools.h++, check the build guide for the DLL naming conventions. The Tools.h++ Professional DLLs are named:

All of the DLLs are located in:

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.

This example compiler command line (typed all on one line) builds myapp.cpp with a no standard library, single-threaded, no debugging version of Tools.h++ Professional. The application uses the net library from the Networking module.

4.7.3 Compiling from Microsoft Visual Studio

To build a program that uses Tools.h++ Professional 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 your particular configuration of the Tools.h++ Professional and Tools.h++ products.

See the Microsoft Visual Studio help system for detailed instructions on configuring Visual Studio.


Previous fileTop of DocumentContentsNext file

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