Contents
Introduction About STLport SGI STL Base STLport Story STLport Features Portability Debug Mode Thread Safety Exception Safety Getting Started Download and Install Select Streams Mode Compiling with STLport White Papers Release Notes READMEs Interface with std:: Wrappers Config manual Regression Test Exception Test Feedback Bug Reports Forum Appendix Acknowledgements Your Free Licence
| # Getting Started : Installing STLport ### Download To download STLport, please visit download page at stlport.org. It provides stable STLport releases from 2.x to the latest one. If you are interested in contributing to STLport development, you are welcome to try out beta snapshots (usually, pretty stable). ### Unpack After downloading STLport-XXX.tar.gz [zip], unpack it to some place where it is going to be accesible for all compilers you plan to use with this installation. Note : Never overwrite header files that come with the compiler, even if you made a backup - this won't work ! Also, please make sure you do not rename this "stlport" subdirectory into anything else - that may render installation unusable. ### Setup Preferences Look through `<stl/_site_config.h>` to adjust preferences. Do NOT attempt to run "configure" script! It is deprecated, moved to safe standalone folder and should be used as a helper to create initial config for a new compiler only. Your compiler should be auto-recognized. Please edit appropriate configuration header for your compiler directly if you have to make small compiler-specific configuration changes. Only if you recieve error message during compilation which explicitly says "Your compiler version is not recognized by STLport", you will have to do major configuration of STLport before use. To learn how to configure STLport, please read configuration manual. ### STLport Major Modes STLport 4.0 may be used in two different major modes : With SGI iostreams (default). In this mode, you are going to use iostreams 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 SGI iostreams. In this mode, STLport will use wrappers around your compiler's iostreams libabry, just like in STLport releases prior to 4.0. 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 Note: for SunPro CC 5.0 and higher, there is special directory "stlport/SC5" to be set in search path due to specific SUNpro search rules) ### Installing STLport for use without SGI iostreams (Default) 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 __STL_NO_SGI_IOSTREAMS setting in "stlport/stl/_site_config.h" to disable use of SGI iostreams and to use wrappers around your existing iostreams. Note though : New-style ANSI iostreams may not be provided by your compiler vendor; If provided, vendor iostreams are most likely slower than SGI version. If you have decided to disable SGI 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. ### Building STLport (SGI iostreams) library In this mode, you will use SGI implemnentation 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, static/dynamic versions). 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. #### Notes When using STLport as a dynamic library, please make sure you put in the PATH and distribute it together with your executable. This extra dependency is certainly in favor of using static linking. However, if your project deploys any Win DLL's using STLport, you have to use STLport as Win DLL, too. This is because it contains some static variables (like cerr stream) which would otherwise be duplicated in every DLL. This problem does not arise in Unix world. [ Visual C++ specific ] If using STLport as DLL, please be sure to use /MD[d] compiler option to pick up all dynamic libraries. ### Testing STLport STLport provides two test suites - regression test and exception handling test. It is recommended that you run them to verify your new STLport installation works OK.