Building-Qt-4.7.4-for-WindowsCE-StandardSDK: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
(Remove non-functioning "toc" command)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Introduction=
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}


Qt has several configurations to build libraries for Windows CE. One of the most popular configurations for this platform is WinCE5 Standard <span class="caps">SDK</span> for <span class="caps">ARM</span> architecture. Here you will learn about how to have a clean and effortless build of Qt 4.7.4 libraries with this option.
[[Category:HowTo]]
[[Category:HowTo::Qt_Embedded]]


=Prerequisites=
 
= 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 =


# '''Microsoft Windows:''' XP, Vista, 7
# '''Microsoft Windows:''' XP, Vista, 7
# '''Microsoft Visual Studio 2008|2005:''' Since Standard <span class="caps">SDK</span> <span class="caps">API</span> works only with <span class="caps">MSVC</span> compiler, you should have <span class="caps">MSVC</span> installed to build and run libs and applications.
# '''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.
# '''Microsoft Windows CE 5 Standard <span class="caps">SDK</span>:''' Download it from [http://www.microsoft.com/download/en/details.aspx?id=17310 here] ''[microsoft.com]'' and then install.
# '''Microsoft Windows CE 5 Standard SDK:''' Download it from [http://www.microsoft.com/download/en/details.aspx?id=17310 here] and then install.
# '''Qt 4.7.4 source files:''' download it from [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip here] ''[get.qt.nokia.com]'' extract it everywhere you prefer (ie. C:\Qt\qt-everywhere-opensource-src-4.7.1. After extracting finished, rename the folder “qt-everywhere-opensource-src-4.7.1” to “4.7.4CE”.
# '''Qt 4.7.4 source files:''' download it from [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip 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=
= Configuring =
 
Goto '''Control Panel'''-> '''System''', find '''Environment Variables'''.  
Goto '''Control Panel''' -&gt; '''System''', find '''Environment Variables'''.


Insert these paths:
Insert these paths:


Click OK. On WinXP you’ll need to restart your computer for the changes to take effect.
<code>
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
</code>


Now, go to '''Start''' -&gt; '''All Programs''' -&gt; '''Microsoft Visual Studio 2008''' -&gt; '''Visual Studio Tools'''<br /> Right click on '''“Visual Studio 2008 Command Prompt”''', Click '''Run as administrator'''
Click OK. On WinXP you'll need to restart your computer for the changes to take effect.


Now, Qt asks you to choose between installation types (Open Source | Commercial).<br /> Type <code>o [return]</code> for open source or <code>y [return]</code> for a commercial installation.
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'''


Configuration takes few minutes to apply.
<code>
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]
</code>


After the operation finishes, go to '''C:\4.7.4CE\src\3rdparty\libpng''' open file '''pnglibconf.h''' find '''#define <span class="caps">PNG</span>_CONVERT_tIME_SUPPORTED''' and delete or comment out the line. ''(It’s a bug in 4.7.4)''
Now, Qt asks you to choose between installation types (Open Source | Commercial).
Type <code>o [return]</code> for open source or <code>y [return]</code> for a commercial installation.


Now, go to '''C:\4.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.
Configuration takes few minutes to apply.


=Creating Applications=
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. ''<span class="4.7.4 in bug a It's"></span>''


To create applications don’t harm yourself! Open Qt Creator same as before. Make a <span class="caps">GUI</span> application and go on.
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.


=Compile and Run on CE Device=
= Creating Applications =
To create applications don't harm yourself! Open Qt Creator same as before. Make a GUI application and go on.


The easiest way to compile your project is using Qt VS-Addin. Just download the latest version from [http://qt.nokia.com/downloads/visual-studio-add-in here] ''[qt.nokia.com]'' and then install. Now open Visual Studio. You’ll have a new menu '''“Qt”'''. Go to '''Qt''' -&gt; '''Qt Options''' and add a new entry and locate to '''C:\Qt\4.7.4CE''' .
= Compile and Run on CE Device =
The easiest way to compile your project is using Qt VS-Addin. Just download the latest version from [http://qt.nokia.com/downloads/visual-studio-add-in 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''' -&gt; '''Open Project''' and select your project’s '''.pro''' file. Then go to '''Qt''' -&gt; '''Qt project settings''' and set the '''project version''' to '''4.7.4CE''' and then OK.
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.
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=
= 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 <span class="caps">DLL</span>s, which for Qt includes QtCore, Gui etc. so if you’re using Qt as a <span class="caps">DLL</span> in release you can easily find half of the memory used by the <span class="caps">DLL</span>s. In debug you’ll be lucky if the application runs at all!
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:
Ways to work around this include:
# Use Qt as a static library (check license restrictions for this)
# Use Qt as a static library (check license restrictions for this)
# Customize the Qt configuration to only include the bits you need
# Customize the Qt configuration to only include the bits you need
# Package the <span class="caps">DLL</span>s into the platform image
# Package the DLLs into the platform image
 
===Categories:===
 
* [[:Category:HowTo|HowTo]]
** [[:Category:HowTo::Qt Embedded|Qt_Embedded]]

Latest revision as of 12:13, 17 April 2015

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