This section describes how to use Microsoft Visual C++ compilers to compile programs that use Rogue Wave's Standard C++ Library class library.
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 from a Windows NT MS-DOS command prompt. Let's also say that our Standard C++ Library header files are in c:\rwav\workspaces\WINNT4\MSVC60\11s\include, and that we built a static version of Standard C++ Library named std11s.lib. Then we can compile myapp.cpp with the Microsoft C++ compiler with the following command (all on one line):
cl /Gx -Ic:\rwav\workspaces\WINNT4\MSVC60\11s myapp.cpp c:\rwav\workspaces\WINNT4\MSVC60\11s\lib\std11s.lib
This command will compile and link in one step.
The /Gx options tells the compiler to use synchronous exception handling.
The -I option tells the compiler where to find the Rogue Wave header files.
The c:\rwav\workspaces\WINNT4\MSVC60\11s\lib\std11s.lib path is the full path name for a full debug, single-threaded, static Standard C++ Library library for MSVC (substitute as appropriate).
Microsoft Visual C++ allows you to create a Standard C++ Library DLL under Windows 95 and Windows NT.
To use the 32-bit DLL version of Standard C++ Library, you must:
Use the Microsoft runtime DLL.
Define the _RWSTDDLL macro on the compiler command line. This tells the header files to configure for dynamic linking.
Use the -MD or -MDd option on the compiler command line in order to use the release or debug version, respectively, of the Microsoft runtime library DLL.
You must link your program with the import libraries. The names of the import libraries are:
Release Version (no symbolic debugging or assertions):
Standard C++ Library: std8d.lib
Microsoft runtime library: msvcrt.lib
Debug Version (with symbolic debugging and assertions):
Standard C++ Library: std11d.lib
Microsoft runtime library: msvcrtd.lib
The Standard C++ Library DLL is std3<build#>d.dll. See Section 2.4 for information on build numbers.
When you run your program, the Standard C++ Library and Microsoft runtime library DLLs 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.
To use the multithread-safe version of the library, you need to:
Add the Standard C++ Library include directory to your list of include directories.
Add the import library name to your list of link objects.
Define the macro RWSTD_MULTI_THREAD. This will communicate to the Standard C++ Library header files your intention to use a multithread-safe version of the library.
Use the /MT option on the command line.
For example, to build a program called test.exe as a multithread-safe library, you could use the following command (all on one line):
cl /MT -DRWSTD_MULTI_THREAD -Ic:\rwav\workspaces\WINNT4\MSVC60\12d\include test.cpp c:\rwav\workspaces\WINNT4\MSVC60\12d\std12d.lib
To build a program that uses Standard C++ Library 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 Standard C++ Library.
See the Microsoft Visual Studio help system for instructions on making changes to a project configuration.
©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.