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

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Introduction=
[[Category:HowTo]]<br />[[Category:HowTo::Qt_Embedded]]


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.
[toc align_right=&quot;yes&amp;quot; depth=&quot;2&amp;quot;]


=Prerequisites=
= Introduction =


# '''Microsoft Windows:''' XP, Vista, 7
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.
# '''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 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.
# '''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”.


=Configuring=
= Prerequisites =


Goto '''Control Panel''' -&gt; '''System''', find '''Environment Variables'''.
# '''Microsoft Windows:''' XP, Vista, 7
# '''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 SDK:''' Download it from &quot;here&amp;quot;:http://www.microsoft.com/download/en/details.aspx?id=17310 and then install.
# '''Qt 4.7.4 source files:''' download it from &quot;here&amp;quot;:http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip extract it everywhere you prefer (ie. C:<s>everywhere-opensource-src-4.7.1. After extracting finished, rename the folder &quot;qt-everywhere-opensource-src-4.7.1&amp;quot; to &quot;4.7.4CE&amp;quot;.
<br />h1. Configuring
<br />Goto '''Control Panel'''</s>&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><br />INCLUDE= C:Files\Microsoft Visual Studio 9.0\VC\ce\include;C:Files\Windows CE Tools\wce500\STANDARDSDK_500\Include\Armv4i<br />LIB= C:Files\Microsoft Visual Studio 9.0\VC\ce\lib\armv4i;C:Files\Windows CE Tools\wce500\STANDARDSDK_500\Lib\ARMV4I<br />QMAKESPEC= win32-msvc2008<br />QTDIR= C:.7.4CE<br /></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'''
 
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.
 
Configuration takes few minutes to apply.
 
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, 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.
 
=Creating Applications=
 
To create applications don’t harm yourself! Open Qt Creator same as before. Make a <span class="caps">GUI</span> 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 [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''' .


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


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, go to '''Start''' <s>&gt; '''All Programs'''</s>&gt; '''Microsoft Visual Studio 2008''' -&gt; '''Visual Studio Tools'''<br />Right click on '''&quot;Visual Studio 2008 Command Prompt&amp;quot;''', Click '''Run as administrator'''


=WinCE 5 Memory Usage=
<code><br />Cd[return]<br />Cd Qt\4.7.4CE [return]<br />set path=path;c:4.7.4ce\bin [return]<br />configure -platform win32-msvc2008 -xplatform wince50standard-armv4i-msvc2008 -release -D QT_NO_CURSOR=1 <s>qt-sql-sqlite [return]<br /></code>
<br />Now, Qt asks you to choose between installation types (Open Source | Commercial).<br />Type &lt;code&amp;gt;o [return]&lt;/code&amp;gt; for open source or &lt;code&amp;gt;y [return]&lt;/code&amp;gt; for a commercial installation.
<br />Configuration takes few minutes to apply.
<br />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&#39;s"></span>''
<br />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.
<br />h1. Creating Applications
<br />To create applications don't harm yourself! Open Qt Creator same as before. Make a GUI application and go on.
<br />h1. Compile and Run on CE Device
<br />The easiest way to compile your project is using Qt VS-Addin. Just download the latest version from &quot;here&amp;quot;:http://qt.nokia.com/downloads/visual-studio-add-in and then install. Now open Visual Studio. You'll have a new menu '''&quot;Qt&amp;quot;'''. Go to '''Qt'''</s>&gt; '''Qt Options''' and add a new entry and locate to '''C:.7.4CE''' .


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!
Now, you can go to '''Qt''' <s>&gt; '''Open Project''' and select your project's '''.pro''' file. Then go to '''Qt'''</s>&gt; '''Qt project settings''' and set the '''project version''' to '''4.7.4CE''' and then OK.


Ways to work around this include:
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.


# Use Qt as a static library (check license restrictions for this)
= WinCE 5 Memory Usage =
# Customize the Qt configuration to only include the bits you need
# Package the <span class="caps">DLL</span>s into the platform image


===Categories:===
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!


* [[:Category:HowTo|HowTo]]
Ways to work around this include:<br /># Use Qt as a static library (check license restrictions for this)<br /># Customize the Qt configuration to only include the bits you need<br /># Package the DLLs into the platform image
** [[:Category:HowTo::Qt Embedded|Qt_Embedded]]

Revision as of 09:29, 24 February 2015


[toc align_right="yes&quot; depth="2&quot;]

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&quot;:http://www.microsoft.com/download/en/details.aspx?id=17310 and then install.
  4. Qt 4.7.4 source files: download it from "here&quot;:http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip 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&quot; to "4.7.4CE&quot;.


h1. Configuring
Goto Control Panel
> System, find Environment Variables.

Insert these paths:

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

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&quot;, Click Run as administrator

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


Now, Qt asks you to choose between installation types (Open Source | Commercial).
Type <code&gt;o [return]</code&gt; for open source or <code&gt;y [return]</code&gt; 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.
h1. Creating Applications
To create applications don't harm yourself! Open Qt Creator same as before. Make a GUI application and go on.
h1. 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&quot;:http://qt.nokia.com/downloads/visual-studio-add-in and then install. Now open Visual Studio. You'll have a new menu "Qt&quot;. 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:
# Use Qt as a static library (check license restrictions for this)
# Customize the Qt configuration to only include the bits you need
# Package the DLLs into the platform image