1*c2c66affSColin Finck 2*c2c66affSColin Finck======================================== 3*c2c66affSColin FinckSTLport README for eMbedded Visual C++ 4 4*c2c66affSColin Finck======================================== 5*c2c66affSColin Finck 6*c2c66affSColin Finckby: Zdenek Nemec, zero@mapfactor.com, last edited 2005-10-17 7*c2c66affSColin Finck 8*c2c66affSColin Finck============ 9*c2c66affSColin FinckIntroduction 10*c2c66affSColin Finck============ 11*c2c66affSColin FinckThis document should provide step-by-step guidance for installing, testing and using the STLport library under Windows CE .NET 4.x 12*c2c66affSColin Finck(aka Windows Mobile 2003 aka Pocket PC 2003). 13*c2c66affSColin FinckFor any further comments or questions visit the STLport mailing lists 14*c2c66affSColin Finckhttp://stlport.sourceforge.net/Maillists.shtml or forums 15*c2c66affSColin Finckhttps://sourceforge.net/forum/?group_id=146814 16*c2c66affSColin Finck 17*c2c66affSColin Finck============= 18*c2c66affSColin FinckPrerequisites 19*c2c66affSColin Finck============= 20*c2c66affSColin FinckTo build and use the STLport you will need following tools and libraries: 21*c2c66affSColin Finck - eMbedded Visual C++ 4.0 SP4 22*c2c66affSColin Finck - an SDK for your target platform with RTTI support 23*c2c66affSColin Finck 24*c2c66affSColin Finck================ 25*c2c66affSColin FinckBuilding STLport 26*c2c66affSColin Finck================ 27*c2c66affSColin FinckFirst, make sure that RTTI is available. Not all SDKs that come with eVC4 also include 28*c2c66affSColin Finckthe necessary libs, but there is a patch for the PPC2003 SDK, available at 29*c2c66affSColin Finckhttp://support.microsoft.com/default.aspx?scid=kb;[LN];830482. 30*c2c66affSColin Finck 31*c2c66affSColin FinckSecond, open command line and set proper system variables. 32*c2c66affSColin FinckThis can be done by using batch files under your 'eMbedded Visual C++' directory(use either WCEemulator.BAT if you want to build STLport for the emulator or WCEARMV4.BAT if you intend to aim an ARM device). 33*c2c66affSColin FinckNOTE: If you are using Microsoft's batch files to set system variables check if both WCEROOT and SDKROOT vars are set to correct locations. example: 34*c2c66affSColin FinckWCEROOT=C:\Program Files\Microsoft eMbedded C++ 4.0 35*c2c66affSColin FinckSDKROOT=C:\Program Files\Windows CE Tools 36*c2c66affSColin Finck 37*c2c66affSColin FinckThird, when you are 100percent sure you've set correctly systems variables go to the STLport/build/lib dir and run the configure.bat with 38*c2c66affSColin Finckproper -c option (ie. "-c evc4"), 39*c2c66affSColin Finckthen invoke following command: 'nmake /fmsvc.mak install' to build the library. 40*c2c66affSColin Finck 41*c2c66affSColin FinckIf anything goes wrong check if you met all prerequisities and if you set system vars accordingly to the makfile you are using. 42*c2c66affSColin FinckAt the end of build process you should have some libs installed in STLport/lib/evc4-arm or STLport/lib/evc4-x86 and dynamic libs in STLport/bin directory. 43*c2c66affSColin Finck 44*c2c66affSColin FinckYou might want to repeat all those steps if you would like to have 45*c2c66affSColin Fincke.g. both ARM and x86 emulator binaries, just don't forget to do 46*c2c66affSColin Finck'nmake /fmsvc.mak clobber' before new build. 47*c2c66affSColin Finck 48*c2c66affSColin FinckNote: MIPS platform is also available for build, but it may not compile or work properly. Use with caution! 49*c2c66affSColin Finck 50*c2c66affSColin Finck=============== 51*c2c66affSColin FinckTesting STLport 52*c2c66affSColin Finck=============== 53*c2c66affSColin FinckWhen you successfuly build STLport libs, you should go to STLport/test/unit directory build and run the STLP test suite. 54*c2c66affSColin FinckUse 'nmake /fmsvc.mak' and keep in mind that you still have to have proper system variables set! 55*c2c66affSColin FinckOnce test build has finished upload and run stlp_unit_test.exe to your emulator or device. 56*c2c66affSColin FinckWait for a while (aprox. 2mins) until all tests are done. 57*c2c66affSColin FinckYou should see two files next to your binary now. 58*c2c66affSColin FinckCheck stlp_test.txt for any errors. If all tests passed you are ready to deploy STLport. 59*c2c66affSColin FinckIf some test fails don't worry and check the STLport forum if it's already reported bug or you have found a new one. 60*c2c66affSColin Finck 61*c2c66affSColin Finck============= 62*c2c66affSColin FinckUsing STLport 63*c2c66affSColin Finck============= 64*c2c66affSColin FinckSetting up the IDE: 65*c2c66affSColin FinckBefore you start using STLport you have to set proper include and libraries search paths. 66*c2c66affSColin FinckGo to 'Tools'>'Options' menu in your eVC 4.0 and then to 'Directories' tab. 67*c2c66affSColin FinckFor every platform you want to use STLport add STLport/stlport directory to the FIRST place in 'Include Files' 68*c2c66affSColin Finckand STLport/lib directory in 'Library files' section. 69*c2c66affSColin Finck 70*c2c66affSColin FinckSetting up projects: 71*c2c66affSColin FinckWhen using STLport together with MFC, you have to define _STLP_USE_MFC to properly include and use STLport. 72*c2c66affSColin Finck 73*c2c66affSColin FinckBy default, exception support is not activated. You can detect this via _CPPUNWIND and activate this via /GX. 74*c2c66affSColin FinckWithout exception support, e.g. std::bad_alloc is not available, causing compile errors for some code. 75*c2c66affSColin Finck 76*c2c66affSColin FinckAlso, there is only one runtime available but the IDE doesn't add the corresponding switch to the command line. 77*c2c66affSColin FinckThe right switch (selecting a dynamically linked runtime) is IMHO /MD or /MDd. This then also switches STLport to dynamic linking. 78*c2c66affSColin FinckAlternatively, you can #define _DLL for your project, which achieves the same but, again IMHO, is a less clean solution. 79*c2c66affSColin Finck 80*c2c66affSColin Finck============ 81*c2c66affSColin FinckKnown issues 82*c2c66affSColin Finck============ 83*c2c66affSColin Finck- The compilers that come with eVC4 are almost bug-to-bug compatible with 84*c2c66affSColin Finckthe one from VC6, so most workarounds for that compiler apply here, too. 85*c2c66affSColin Finck 86*c2c66affSColin Finck- There is a bug in the MIPS compiler that comes with eVC4 which only surfaces 87*c2c66affSColin Finckunder certain conditions: 88*c2c66affSColin Finck * in release mode with global optimizations on (#pragma optimize("g", on)) 89*c2c66affSColin Finck * a baseclass has (at least) two pointer members 90*c2c66affSColin Finck * a derived class adds no data members 91*c2c66affSColin Finck * the derived class' cctor defers to the basclass' compiler-generated cctor 92*c2c66affSColin Finck * it is passed as template parameter to a function 93*c2c66affSColin FinckThe smallest testcase I could come up with is this: 94*c2c66affSColin Finck struct base { 95*c2c66affSColin Finck void* ptr1; 96*c2c66affSColin Finck void* ptr2; 97*c2c66affSColin Finck }; 98*c2c66affSColin Finck struct derived: public base { 99*c2c66affSColin Finck derived() {} 100*c2c66affSColin Finck derived(const derived& __x): base(__x) {} 101*c2c66affSColin Finck }; 102*c2c66affSColin Finck 103*c2c66affSColin Finck template<typename SomeType> void function( SomeType st1, SomeType st2) {} 104*c2c66affSColin Finck 105*c2c66affSColin Finck struct test { 106*c2c66affSColin Finck derived tmp; 107*c2c66affSColin Finck ~test() { function(tmp, tmp); } 108*c2c66affSColin Finck }; 109*c2c66affSColin Finck test test; 110*c2c66affSColin Finck..which causes an internal compiler error. Removing the base::ptr1, adding data 111*c2c66affSColin Finckto derived, making function() a normal function, or turning off optimization 112*c2c66affSColin Finck(#pragma optimize("g", off)) all causes the code to compile. This bug affects 113*c2c66affSColin Finckiterators of deque and vector<bool>. 114*c2c66affSColin Finck 115*c2c66affSColin Finck- Because of interdependancy between STLport and native Standard library headers 116*c2c66affSColin FinckSTLport headers should always be included first in your translation unit (.cpp 117*c2c66affSColin Finckfile). That is to say that: 118*c2c66affSColin Finck 119*c2c66affSColin Finck//Wrong headers order: 120*c2c66affSColin Finck#include <windows.h> 121*c2c66affSColin Finck#include <cstdlib> 122*c2c66affSColin Finck 123*c2c66affSColin Finck// Correct headers order 124*c2c66affSColin Finck#include <cstdlib> 125*c2c66affSColin Finck#include <windows.h> 126*c2c66affSColin Finck 127