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.


I had to make the following adjustments to make it work for me since vc2010 doesn't by default have the bin in the path. AWESOME and THANKS!

call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
call configure.bat msvc10
call cd build\lib
set path=%path%;"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin"
call nmake clean install

Thanks for this it worked great and improved my day 100% :)


Not sure why it works for me without your change, I don't seem to have that bin path in my path. I thought that vcvars would set that up for me anyway.

Anyway, glad the patches helped.

Manually patched _cstdlib.h and I'm good to go...
That wasn't so painful!

You are my hero...

Thanks you for this wonderful information. I have upgraded it for VS2012.
I have a request, can you please help me to integrate STLport as Visual Studio project and build it from VS IDE.

I'm no longer using STLPort and so haven't got scripts for later compilers. Sorry. I'd be happy to quote you a price for setting up STLPort Visual Studio projects but I'm afraid I can't do it for free.

Leave a comment