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 _STLP_USE_OWN_NAMESPACE.  Using  _STLP_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.
  • _STLP_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, _STLP_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 _STLP_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 _STLP_USE_MALLOC or _STLP_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 _STLP_NO_NEW_IOSTREAMS in <stl_user_config.h> or at the command line.
    If you are going to use new-style <iostream> without defining _STLP_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.

 



Table of Contents

News  Company  Product  Services  Community  Forum  Download  Home  


Copyright 2001 by STLport