STLPort & MPW Notes

STLPort is Standard Template Library (right now part of C++ ANSI/ISO standards) implementation intended for C++ compilers which do not have complete support for templates and namespaces Unfortunately, Apple MrCpp is one of them. In general, STLPort represents cross-platform, open source and freeware adoption of SGI STL, developed by Moscow Center of SPARC Technologies, which supports enormous number of OS platforms and compilers. It takes some time to get it work, however.

Here is how to get them work together:

  1. Download Apple MPW (Macintosh Programmers Workshop), latest Universal Interfaces, and MrCpp Compiler from Apple Development Site.
  2. Install all MPW components (have to learn how to do it yourself).
  3. Download STLPort 3.21 and/or 4.x from site. STLPort 4 needs few modifications to coexist nicely with MrCpp.
  4. Put STLPort into MPW folder.
  5. Follow instruction supplied with STLPort to build STL test.

Finally, your MPW & STLPort should look like this (you do not need Ad Lib, Apple Frameworks, CarbonLib SDK, OpenGL SDK to use STLPort):


How to Build STLPort Precompiled Header:

  • At first, download STLPort Additions.
  • Put UserStartup¸1STL into MPW:Startup. I took this startup script from Apple MacApp distribution. It defines {STL} shell variable which contains path to STLPort location.
  • Using precompiled header could cut compilation time several times. Please follow this instruction:
    1. STLPort Additions contains the following files (along with UserStartup¸1STL): new make file MrCpp.mak, header stl_precompile.h and MPW script MrCppCompile.
    2. Replace file MrCpp.mak in STLPort distribution with one from my STLPort Additions.
    3. Put file stl_precompile.h into STLPort folder.
    4. Find statement ObjDir_PPC = "HD:Applications:MPW:STLPort:Objects:" in MrCpp.mak and replace with your own path.
    5. Update MrCppCompile with your own path.
    6. Run MrCppCompile in MPW Shell.

  • Use snippets from MrCpp.mak to build your own STL-based project.

Some STLPort Tips, Tricks & Issues:

  • MrCpp v3.x, 4.x and 5.0d1c1 (no newer 5.x versions at this time) do not support precompiled headers with templates. Undefine macro STL_PRECOMPILE_STLSTD_H in MrCpp.mak. Otherwise you will face weird internal compiler errors.
  • MrCpp 5.0d1c1have certain problems with C++ name mangling. No solution until newer version.
  • PPCLink really needs a lot of RAM to link many object files. Turn off Faster Linking option to reduce memory requirements.

PS. Apple abandoned MPW in favor of proven GNU UNIX-based tools (in fact, MPW emulates UNIX command-line shell under classic MacOS). gcc (GNU C/C++ compiler) is no questions more stable and capable rather than Apple's own MrCpp. At the time I am writing this Apple is in process of incorporating advanced optimization features from MrCpp to PowerPC MacOS X version of gcc.

MacGuruHQ and MacGuruHQ Logo

Copyright© 1996 - 2002 by Andrei Verovski. All right reserved. Content may not be copied in whole or in part, through electronic or other means, without the author's permission. MacGuru Logo (blue penguin) by Sergey Orehov.