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