Building-Qt-4.7.4-for-WindowsCE-StandardSDK

From Qt Wiki
Revision as of 12:13, 17 April 2015 by AutoSpider (talk | contribs) (Remove non-functioning "toc" command)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.


Introduction

Qt has several configurations to build libraries for Windows CE. One of the most popular configurations for this platform is WinCE5 Standard SDK for ARM architecture. Here you will learn about how to have a clean and effortless build of Qt 4.7.4 libraries with this option.

Prerequisites

  1. Microsoft Windows: XP, Vista, 7
  2. Microsoft Visual Studio 2008|2005: Since Standard SDK API works only with MSVC compiler, you should have MSVC installed to build and run libs and applications.
  3. Microsoft Windows CE 5 Standard SDK: Download it from here and then install.
  4. Qt 4.7.4 source files: download it from here extract it everywhere you prefer (ie. C:-everywhere-opensource-src-4.7.1. After extracting finished, rename the folder "qt-everywhere-opensource-src-4.7.1" to "4.7.4CE".

Configuring

Goto Control Panel-> System, find Environment Variables.

Insert these paths:

INCLUDE= C:Files\Microsoft Visual Studio 9.0\VC\ce\include;C:Files\Windows CE Tools\wce500\STANDARDSDK_500\Include\Armv4i
LIB= C:Files\Microsoft Visual Studio 9.0\VC\ce\lib\armv4i;C:Files\Windows CE Tools\wce500\STANDARDSDK_500\Lib\ARMV4I
QMAKESPEC= win32-msvc2008
QTDIR= C:.7.4CE

Click OK. On WinXP you'll need to restart your computer for the changes to take effect.

Now, go to Start -> All Programs-> Microsoft Visual Studio 2008 -> Visual Studio Tools Right click on "Visual Studio 2008 Command Prompt", Click Run as administrator

Cd[return]
Cd Qt\4.7.4CE [return]
set path=path;c:4.7.4ce\bin [return]
configure -platform win32-msvc2008 -xplatform wince50standard-armv4i-msvc2008 -release -D QT_NO_CURSOR=1 -qt-sql-sqlite [return]

Now, Qt asks you to choose between installation types (Open Source | Commercial).

Type

o [return]

for open source or

y [return]

for a commercial installation.

Configuration takes few minutes to apply.

After the operation finishes, go to C:.7.4CE\src\3rdparty\libpng open file pnglibconf.h find #define PNG_CONVERT_tIME_SUPPORTED and delete or comment out the line.

Now, go to C:.7.4CE open projects.sln using MS Visual Studio. Change the compile mode from Debug to Release. Go to Build menu and click Build All. It takes long time to compile the entire solution. Just relax and drink a cup of tea or coffee.

Creating Applications

To create applications don't harm yourself! Open Qt Creator same as before. Make a GUI application and go on.

Compile and Run on CE Device

The easiest way to compile your project is using Qt VS-Addin. Just download the latest version from here and then install. Now open Visual Studio. You'll have a new menu "Qt". Go to Qt-> Qt Options and add a new entry and locate to C:.7.4CE .

Now, you can go to Qt -> Open Project and select your project's .pro file. Then go to Qt-> Qt project settings and set the project version to 4.7.4CE and then OK.

Now connect your device to the PC using ActiveSync or Windows Mobile Center on Win7. By clicking Run on Visual Studio you'll see the project is uploading to the device and executing.

WinCE 5 Memory Usage

One thing to remember when running on WinCE5 is that each application only has 32MB available to it, no matter how much actual memory the board has. This 32MB includes the space used by the applications DLLs, which for Qt includes QtCore, Gui etc. so if you're using Qt as a DLL in release you can easily find half of the memory used by the DLLs. In debug you'll be lucky if the application runs at all!

Ways to work around this include:

  1. Use Qt as a static library (check license restrictions for this)
  2. Customize the Qt configuration to only include the bits you need
  3. Package the DLLs into the platform image