STLPORT 5.2.1 AND VS2010 AND X64

| 5 Comments

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.

5 Comments

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!

build-msvc10-x86.bat
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% :)

Corey,

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...

Leave a comment

About this Entry

Step over library code when debugging C++ in Visual Studio was the previous entry in this blog.

Practical Testing: 21 - Looking at Performance and finding a leak is the next entry in this blog.

I usually write about C++ development on Windows platforms, but I often ramble on about other less technical stuff...

Find recent content on the main index or look in the archives to find all content.

I have other blogs...

Subscribe to feed The Server Framework - high performance server development
Subscribe to feed Lock Explorer - deadlock detection and multi-threaded performance tools
Subscribe to feed l'Hexapod - embedded electronics and robotics
Subscribe to feed MegèveSki - skiing