Selecting IOStreams Mode
Major IOStream Modes
STLport 4.0 may be used in two different major modes :
For any of these modes, please make sure
"stlport" directory containing header files
is the first one in your include search path when you compile the project
- With STLport iostreams (default). In this mode, you are going to use iostreams
and complex libraries provided by STLport.
To do so, first you have to build STLport library from sources
provided in "src" subdirectory and link your programs with it.
This is major change since pre-4.0 releases, please read the instructions carefully.
- Without STLport iostreams. In this mode, STLport will use wrappers around
your compiler's iostreams and complex libraries, just like in STLport
releases prior to 4.0.
Installing STLport for use without STLport iostream library ("wrapper mode")
In this mode, you will use wrappers around your compiler's iostreams
libabry, as in previous STLport releases.
All you have to do to use STLport in this mode is to uncomment
_STLP_NO_OWN_IOSTREAMS setting in "stlport/stl/_site_config.h"
to disable use of STLport iostreams and to use wrappers around your existing iostreams.
(For SUN CC, you still have to go to "src" subdirectory and do "make" or at least "make prepare" to produce additional .SUNWCCh files necessary for compilation)
Note though :
If you have decided to disable STLport iostreams, you may stop reading here.
To use wrapper mode, you do not have to build any binary libraries, as everything you need
is contained in the header files already.
- For the most modern compilers which implements Koenig lookup properly, this option may not be available due to ambiguities during namespace lookup. Example: gcc-3.0
- New-style ANSI iostreams and/or complex library
may not be provided by your compiler vendor;
- If provided, vendor iostreams may appear to be slower than STLport version.
Building STLport iostreams library (Default Mode)
In this mode, you will use STLport implementation of iostreams instead of the one that comes
with your compiler. It does contain some non-template code so you have to build STLport
iostreams library in "src" directory to link your project with.
Below are step-by-step instructions to build STLport library:
- Do make sure you have followed instructions for default installation above.
- Go to "src" subdirectory. It contains various makefiles for different compilers.
If iostreams library is not yet ported to your compiler (please see Release Notes for details), you may revert to use "wrapper" mode or port it. Please refer
to porting document to learn how to port iostreams library
to your compiler. The porting procedure is usually straightforward on UNIXes.
- Using appropriate makefile, do "make clean all" to build STLport libraries
(makefiles are set up to build several different flavors - debug/nondebug,
Note : your make program may have different name, like "nmake" for Visual C++, so, with "nmake", do "nmake clean all"
- If make fails, you may try fixing the build yourself and/or report it to STLport Forum.
- Do "make install" to install resulting libraries into "lib" subdirectory. On Windows, this step also copies .dll libraries to system directory to be accessible at runtime.
STLport provides two test suites - regression
test and exception handling test.
It is recommended that you build and run them in place to verify your new STLport installation is OK.