STLPORT 5.2.1 AND VS2010 AND X64

I have been updating some client code to VS2010 and they use STLPort for the STL as it has better performance in multi-threaded situations than the version that comes with Visual Studio (see here). This has meant that I’ve needed to build STLPort 5.2.1 with VS2010 for x86 and x64. As with my previous builds of STLPort the compiler isn’t currently officially supported so I had to hack my installation to get it all to build, etc.

The changes are similar to those required for getting VS2008 to work with STLPort 5.1.5 (and 5.2.1) see here for details of those.

The easy things are the make file changes; editing build\lib\configure.bat, build\lib\msvc.mak and build\Makefiles\targets.mak to add support for msvc10 and adding some makefiles for vc10 that are copies of the vc9.mak files.

Once that’s done you can build with Visual Studio 2010. The first build break that needs fixing is the fact that stlport\stl\_cstdlib.h contains a redefinition of abs() that VS2010 doesn’t need. I simply wrapped the block of defines in a #if !defined(_STLP_MSVC) || (_STLP_MSVC < 1600) block.

Then stlport\stl\config\_autolink.h needed changing to allow for the side by side installation that my build provides me with (see the notes on the VS2008 changes for more details).

The zip file here contains the changes that you need to apply, simply copy them over the top of the default STLPort 5.2.1 directory structure. Note that this zip file includes both the side by side changes and the VS2010 build changes, if you don’t want the side by side stuff then see here for details of which changes they are and back them out.