söndag 1 november 2009

Building STLPort for Windows CE with Visual Studio 2005

As we want to use Boost in our WinCE project, we needed a full implementation of STL (including streams support). I never got Microsofts STL implementation to build for our device, probably because of some difference in the C library on our SDK. Therefore I decided to use STLPort which is designed to be more portable.

The documentation on STLPort is far from comprehensive, and it took me a great deal of time until I found the right information in the docs and on the forum to build the thing. Below is the script that sets up all needed enviornment variables and configures STLPort.

It should work for other versions of MSVC as well. Just change all the set to point to the right directories. I am not sure the use-boost is really needed

@echo off
set STLROOT=C:\STLport-5.2.1
cd %STL_ROOT%


set OSVERSION=WCE500
set PLATFORM=BACX
set ARCH=ARMV4I
set SDKROOT=C:\workspace\Alpha\main\SDK\wce500
set VSROOT=C:\Program Files\Microsoft Visual Studio 8
set BOOSTROOT=C:\Program Files\Boost\boost_1_40_0


call "%VSROOT%\VC\vcvarsall.bat"

set PATH=%VSROOT%\VC\ce\bin;%VSROOT%\VC\ce\bin\x86_arm;%VSROOT%\VC\bin;%VSROOT%\Common7\IDE;;%PATH%


set INCLUDE=%SDKROOT%\%PLATFORM%\include\%ARCH%;%SDKROOT%\%PLATFORM%\ATL\include;;%INCLUDE%


set LIB=%SDKROOT%\%PLATFORM%\lib\%ARCH%;%SDKROOT%\%PLATFORM%\ATL\lib\%ARCH%;%VSROOT%\VC\ce\lib\%ARCH%;;%LIB%


set CC=cl.exe
set TARGETCPU=ARMV4I
set CFG=none

call configure evc8 -x --with-static-rtl --use-boost %BOOSTROOT%

cd %STL_ROOT%/build/lib
nmake install