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