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
| # Note For Visual C++ Users ## Known problems #### Compiling If your program is multi-threaded, make sure you defined macro `_REENTRANT` to enable proper synchronization (if you are using SGI node allocator. If you are using new_alloc or malloc_alloc, you won't need that). You may encounter problems using `<iostream>` in mix with SGI STL `<string>, <stdexcept>` without defining __STL_USE_OWN_NAMESPACE. Using __STL_USE_OWN_NAMESPACE is the most safe way to cooperate with new I/O library and is definitely recommended unless you recompile the whole C++ std library with STLport installed. `__STL_USE_EXCEPTIONS` is being defined automatically if the compiler defined `_CPPUNWIND` macro ("`/GX`" option). So you should not worry about it. There were reports that Visual C++ 4.0 have problems with namespaces in certain cases. Due to that, `__STL_NO_NAMESPACES` defined for it in <stlcomp.h>. You may encounter problems with too long symbols when compiling with debug information. To handle this, try defining `__STL_USE_ABBREVS` in `stlcomp.h`. You may experience problems with default SGI node allocator. I had no such problems, though. Default node allocator is quite fast, so I wouldn't recommend disabling it without serious reason. However, if it causes problems, define `__STL_USE_MALLOC` or `__STL_USE_NEWALLOC` to get bare malloc()-based or new()-based default allocator. If your program is multi-threaded, make sure you defined macro `_REENTRANT` to enable proper synchronization. [ VC++ 4.2 and higher] This version allows use of new-style <iostream>, <string> with STLport , as well as the old-style <iostream.h> . The default is new <iostream> usage. If you want to use old-style <iostream.h> in your project: define macro __STL_NO_NEW_IOSTREAMS in <stl_user_config.h> or at the command line. If you are going to use new-style <iostream> without defining __STL_USE_OWN_NAMESPACE: You may have to edit relative (or set full) path to VC++ native headers`` in <stl_user_config.h>. Using native versions is necessary to avoid clashes with compiled code in C++ runtime library. In the whole project, use coherent set of headers : all new-style. You may also try SGI STL adapted for MSVC++ 5.0 only, by Wayne Ouchida. (Note : looks like it's out of date and discontinued. It doesn't provide debug support and other extensions of this adaptation). ## Migration notes You should experience no other problems migrating from VC++ STL to SGI STL. Default `allocator<T>` in this adaptation is fully functional. #### Versions prior to 4.0 Visual C++ older than 4.0 won't compile STL. You have to upgrade.