1*c2c66affSColin FinckProgramming under MS Windows CE with STLport
2*c2c66affSColin Finck=============================================
3*c2c66affSColin Finck
4*c2c66affSColin FinckThis is supposed to give an overview for programming on MS Windows CE, with and
5*c2c66affSColin Finckpartially without STLport, what tools are available and what common pitfalls
6*c2c66affSColin Finckexist. Note that for every supported compiler there is another readme file which
7*c2c66affSColin Finckexplains the specifics of that compiler.
8*c2c66affSColin Finck
9*c2c66affSColin Finck
10*c2c66affSColin Finck
11*c2c66affSColin FinckAvailable compilers:
12*c2c66affSColin Finck---------------------
13*c2c66affSColin Finck
14*c2c66affSColin Finck- Embedded Visual C++ 3 (eVC3): this IDE/compiler is for the CE3 target platforms.
15*c2c66affSColin FinckThe included compiler is MSC12, the same as for VC6, so many workarounds for its
16*c2c66affSColin Finck'features' apply here, too. STLport works out of the box with this.
17*c2c66affSColin Finck
18*c2c66affSColin Finck- Embedded Visual C++ 4 (eVC4): basically the same as eVC3, but it can compile for
19*c2c66affSColin FinckCE4.x and 5. Note that currently (2007-03-06) I haven't tested this with CE5,
20*c2c66affSColin Finckbecause you can use a better compiler using VC8/VS2005. This compiler can be
21*c2c66affSColin Finckdownloaded for free from the MS website, including a product activation key.
22*c2c66affSColin FinckSTLport works out of the box with this.
23*c2c66affSColin Finck
24*c2c66affSColin Finck- Visual C++ 8 (VC8) aka Visual Studio 2005 (VS2005): with this version (and
25*c2c66affSColin Finckpartially already version 7) the embedded and desktop IDEs have been merged again,
26*c2c66affSColin Finckso it supports compiling for MS Windows CE, versions 5 and later. Note that the
27*c2c66affSColin Finckfreely downloadable express edition does not(!) allow compiling for CE. This IDE
28*c2c66affSColin Finckuses MSC14 as compiler. STLport works out of the box with CE5.
29*c2c66affSColin Finck
30*c2c66affSColin Finck- Platform Builders (PB): this tool is used to create a CE image. You can select the
31*c2c66affSColin Finckmodules (e.g. Explorer, but also C++ RTTI) you include in the image. These IDEs use
32*c2c66affSColin Finckseveral different compilers (MSC12-14). STLport hasn't been tested with this
33*c2c66affSColin FinckIDE, AFAIK.
34*c2c66affSColin Finck
35*c2c66affSColin Finck- There used to be an addon for VC6(?) that allowed compiling for CE. This plugin
36*c2c66affSColin Finckhas been superceeded by eVC3/4 and support for it has been removed from STLport in
37*c2c66affSColin Finckversion 5.
38*c2c66affSColin Finck
39*c2c66affSColin Finck- Others: some vendors (e.g. Intel) provide compilers that are able to generate
40*c2c66affSColin FinckCE executables. I'm not aware of an attempt to compile STLport with them.
41*c2c66affSColin Finck
42*c2c66affSColin Finck
43*c2c66affSColin Finck
44*c2c66affSColin FinckEnvironment specialties:
45*c2c66affSColin Finck-------------------------
46*c2c66affSColin Finck
47*c2c66affSColin Finck- In order to develop for a platform, the first thing you need is a so-called SDK.
48*c2c66affSColin FinckThis package includes headers and libraries that (more or less) resemble the APIs
49*c2c66affSColin Finckavailable on the device. The IDEs come with a basic selection of SDKs, but in
50*c2c66affSColin Finckgeneral you need to retrieve an according SDK from the vendor. If you are the
51*c2c66affSColin Finckvendor, you can generate an SDK for a platform with Platform Builder.
52*c2c66affSColin Finck
53*c2c66affSColin Finck- The provided API is typically a subset of the 'normal' win32 API. Often, some
54*c2c66affSColin Finckfeatures are simply not supported, like security descriptors when opening files.
55*c2c66affSColin FinckAlso, these APIs are only supported for wchar_t strings, e.g. only CreateFileW()
56*c2c66affSColin Finckand not CreateFileA().
57*c2c66affSColin Finck
58*c2c66affSColin Finck- CE doesn't have a current directory, hence no relative paths to that dir. You can
59*c2c66affSColin Finckhave relative parts in global paths though.
60*c2c66affSColin Finck
61*c2c66affSColin Finck- CE doesn't have environment variables, thus STLport can't support e.g.
62*c2c66affSColin Fincksetenv/getenv. It also doesn't attempt to provide workarounds.
63*c2c66affSColin Finck
64*c2c66affSColin Finck- Since many features are optional (see the description of Platform Builder), it
65*c2c66affSColin Finckis possible that you don't have e.g. a console that std::cout could write to. The
66*c2c66affSColin Fincksame applies to exceptions (see e.g. the add-on lib for RTTI for eVC4). Other
67*c2c66affSColin Finckfeatures might go amiss, too. This makes it hard for STLport to adapt to, in
68*c2c66affSColin Finckparticular because this information is not available outside PB, a header might
69*c2c66affSColin Finckdeclare a function that in fact is not present. Keep this in mind when you get
70*c2c66affSColin Fincklinker errors.
71*c2c66affSColin Finck
72*c2c66affSColin Finck- The supplied C++ standard library is extremely cut down, e.g. iostreams and
73*c2c66affSColin Fincklocales are missing completely.
74*c2c66affSColin Finck
75*c2c66affSColin Finck- The supplied standard C API is at best rudimentary. Functions like e.g. time() or
76*c2c66affSColin Finckclock() are declared but not defined. STLport doesn't include any workarounds for
77*c2c66affSColin Finckthese missing functions at present.
78*c2c66affSColin Finck
79*c2c66affSColin Finck- All compilers are cross-compilers, i.e. you run them on a win32 host and they
80*c2c66affSColin Finckproduce executable code for the target platform. The same applies to the debugger,
81*c2c66affSColin Finckwhich is connected via serial, USB or ethernet. Alternatively, there are emulators
82*c2c66affSColin Finckthat run on the host machine and simulate the target platform.
83*c2c66affSColin Finck
84*c2c66affSColin Finck- The entrypoint for executables is generally WinMain. Normally, you would have
85*c2c66affSColin Finckswitched to a normal main() using /SUBSYSTEM:CONSOLE on the linker commandline.
86*c2c66affSColin FinckThe linkers for at least CE4 and 5 don't understand this switch, they claim it
87*c2c66affSColin Finckconflicts with CE targets. Instead, set the entrypoint directly to
88*c2c66affSColin FinckmainACRTStartup.
89*c2c66affSColin Finck
90*c2c66affSColin Finck- The name of a DLL loaded via an import library can't be longer than 32 chars. If
91*c2c66affSColin Finckthis is not the case, the application will behave as if the DLL was not present or
92*c2c66affSColin Finckcouldn't be loaded for whatever other reason. This limitation applies to at least
93*c2c66affSColin FinckCE 4 and 5.
94*c2c66affSColin Finck
95