1setup VC9 for CE: 2------------------ 3 4- VC9 doesn't have any setup batchfiles that prepare the environment for compiling 5with CE. You can take those from eVC4 and adapt them or write your own. This snippet 6should get you going: 7 8 rem you need to adapt at least these three 9 set OSVERSION=WCE500 10 set PLATFORM=MY_OWN_PLATFORM 11 set TARGETCPU=MIPSII 12 13 rem the compiler is always cl.exe, different compilers are in different paths 14 set CC=cl.exe 15 rem obviously, these need to be adjusted to where you installed VS2008 and the SDKs 16 set VSINSTALLDIR=C:\Programme\Microsoft Visual Studio 9.0 17 set SDKROOT=C:\Programme\Windows CE Tools 18 19 set PATH=%VSINSTALLDIR%\VC\ce\bin\x86_mips;%VSINSTALLDIR%\VC\bin;%VSINSTALLDIR%\Common7\IDE;%PATH% 20 set PLATFORMROOT=%SDKROOT%\%OSVERSION%\%PLATFORM% 21 22 rem add libs and includes from the SDK 23 set INCLUDE=%PLATFORMROOT%\include\%TARGETCPU%;%PLATFORMROOT%\MFC\include;%PLATFORMROOT%\ATL\include 24 set LIB=%PLATFORMROOT%\lib\%TARGETCPU%;%PLATFORMROOT%\MFC\lib\%TARGETCPU%;%PLATFORMROOT%\ATL\lib\%TARGETCPU% 25 26 rem add libs that came with VC9 27 rem Note: there are more libs and includes under ce\atlmfc, you need to add these 28 rem instead of the ones in the SDK if you want to use the newer version of ATL/MFC. 29 set LIB=%LIB%;%VSINSTALLDIR%\VC\ce\lib\%TARGETCPU% 30 31 32- The snippet below can be used to build STLport for Pocket PC 2003 (using the 33 Pocket PC 2003 SDK shipped with Visual Studio 2008, this is the SDK used when 34 compiling programs from within the IDE): 35 36 set OSVERSION=WCE420 37 set PLATFORM=POCKET PC 2003 38 set TARGETCPU=ARMV4 39 40 rem the compiler is always cl.exe, different compilers are in different paths 41 set CC=cl.exe 42 43 rem obviously, these need to be adjusted to where you installed VS2008 44 set VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 9.0 45 set SDKROOT=%VSINSTALLDIR%\SmartDevices\SDK 46 47 set PATH=%VSINSTALLDIR%\VC\ce\bin\x86_arm;%VSINSTALLDIR%\VC\bin;%VSINSTALLDIR%\Common7\IDE;%PATH% 48 set PLATFORMROOT=%SDKROOT%\PocketPC2003 49 50 rem add libs and includes from the SDK 51 set INCLUDE=%PLATFORMROOT%\include 52 set LIB=%PLATFORMROOT%\lib\%TARGETCPU% 53 54 rem add libs that came with VC9 55 set INCLUDE=%INCLUDE%;%VSINSTALLDIR%\VC\ce\atlmfc\include 56 set LIB=%LIB%;%VSINSTALLDIR%\VC\ce\lib\%TARGETCPU%;%VSINSTALLDIR%\VC\ce\atlmfc\lib\%TARGETCPU% 57 58 59You should now be able to run cl.exe for the target you expected. 60 61- The cross compilers of VC9 are the same version as for the native target, i.e. MSC15. 62 63- In order for STLport to recognize which target you are compiling for, you need to have 64some macros defined, e.g. for the target architecture. The compilers do that partially on 65their own, but not sufficiently. Therefore, STLport requires these defines: 66 67 -- These are generally set for CE: 68 _UNICODE;UNICODE;_WIN32;WIN32;UNDER_CE;WINCE; 69 -- This one uses an environment variable to set the CE version: 70 _WIN32_WCE=$(CEVER); 71 -- These are used to help STLport recognise the target architecture: 72 $(ARCHFAM);$(_ARCHFAM_);$(INSTRUCTIONSET) 73 Note that the instructionset is not strictly needed for x86 but definitely for ARM. It 74 doesn't hurt for x86 though, so I'd always set these in any new project. 75 -- For release builds: 76 NDEBUG; 77 -- For debug builds: 78 DEBUG;_DEBUG; 79 -- For debug builds with additional STLport diagnostics: 80 DEBUG;_DEBUG;_STLP_DEBUG; 81 -- For MFC applications: 82 _AFXDLL; 83 84- Further settings: 85 Code generation: Multithreaded [Debug] DLL 86 Language: enable RTTI 87 Optimization: maximise speed and enable whole program optimization for release builds 88 89- Linker settings: 90 Ignore specific libraries: libc.lib;libcd.lib 91 Commandline: /SUBSYSTEM:WINDOWSCE 92 Optimisation: /LTCG for release builds 93 94- Resource compiler: 95 Define: UNDER_CE;WINCE;_WIN32_WCE=$(CEVER) 96