Windows CE - Working with Custom SDKs

When working with a custom SDK for Windows CE, Qt provides an easy way to add support for it to your development environment. The following is a tutorial that covers how to create a specification for Qt for Windows CE platforms.

Creating a Custom Build Specification

Create a subdirectory in the mkspecs folder of the Qt directory. New specifications for Qt for Windows CE following this naming convention:


Using this convention makes it possible for qmake to identify that you are building Qt for Windows CE, and will customize the compilation process accordingly.

Create the files qmake.conf and qplatformdefs.h inside the new specification directory. Take a look at the implementation of the other Windows CE specifications included in the mkspecs directory to see what is required to build Qt for Windows CE successfully.

Fine-Tuning Options

Compared to the desktop versions, Qt for Windows CE needs two additional options:

  • CE_SDK specifies the name of the SDK.
  • CE_ARCH specifies information about the target architecture.

Following is an example configuration for a custom SDK we call "CustomSDK":

CE_SDK        = Windows Mobile 5.0 Pocket PC SDK
CE_ARCH       = ARMV4I

Note: Running qmake to generate Visual Studio project files for Windows CE currently does not produce valid output..

Additionally, most Windows CE SDKs use extra compiler options. These can be specified by expanding the DEFINES value.

For example, with CustomSDK, the DEFINES variable is expanded in the following way:


Cross-compilation Environment for a Custom SDK

Qt for Windows CE only requires that the mkspec that is specified with -xplatform is setup as mentioned above.

The selection of the custom SDK environment will happen by concatenating CE_SDK and CE_ARCH. This builds a string that can be found in "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcpackages\WCE.VCPlatform.xml" and contains the correct environment. If you are unsure about the SDK name and Arch for your SDK you can find it in this file.

Compiling Qt for a Custom SDK

Windows CE is highly customizable, hence it is possible that some SDKs have feature-stripped setups. Depending on the SDK's configuration, Qt may not compile in its standard configuration, as Qt for Windows CE is designed to be compatible with the Standard SDK setup. Every Makefile qmake generates that is not flagged to build for the host system will build WindowsCE projects for the SDK Qt was built with. There is no need to set a custom environment besides the Visual Studio 2005/2008 environment.

However, it is possible to exclude features of Qt and create a version that compiles for the desired SDK.

Making Qt Applications Start on a Custom Device

Sometimes, a Windows CE device has been created with a configuration different from the corresponding SDK's configuration. In this case, symbols that were available at linking stage will be missing from the run-time libraries.

Unfortunately, the operating system will not provide an error message that mentions which symbols are absent. Instead, a message box with the following message will appear:

app.exe is not a valid CE application!

To identify the missing symbols, you need to create a temporary application that attempts to dynamically load the Qt for Windows CE libraries using LoadLibrary. The following code can be used for this:

wchar_t* libraries[] = {

for (int i = 0; libraries[i] != 0; ++i) {
    HINSTANCE instance = LoadLibraryW(libraries[i]);
    if (instance != NULL) {
        OutputDebugStringW(L" : Successfully instantiated\n");
    } else {
        OutputDebugStringW(L" : Could not be loaded\n");

Once you have compiled and deployed the application as well as the Qt libraries, start a remote debugger. The debugger will then print the ordinal number of the unresolved symbol.

Search for parts of Qt that rely on these functions and disable them using the QFeatures functionality.

In our experience, when Qt applications do not start on Windows CE, it is usually the result of missing symbols for the following classes or features:

Please refer to the Microsoft documentation here for information on what ordinals are and how you can create them. Information on accessing the corresponding symbol name to a given ordinal value can also be found in the Microsoft documentation.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.