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)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:HowTo]]<br />[[Category:HowTo::Qt_Embedded]]
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
 
[[Category:HowTo]]
[[Category:HowTo::Qt_Embedded]]


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


= Introduction =
= Introduction =
Line 11: Line 13:
# '''Microsoft Windows:''' XP, Vista, 7
# '''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 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.
# '''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 &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;.
# '''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".
<br />h1. Configuring
 
<br />Goto '''Control Panel'''</s>&gt; '''System''', find '''Environment Variables'''.  
= Configuring =
Goto '''Control Panel'''-> '''System''', find '''Environment Variables'''.  


Insert these paths:
Insert these paths:


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


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


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


<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>
= Compile and Run on CE Device =
<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.
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''' .
<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''' .


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.
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.
Line 42: Line 63:
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!
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:<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
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

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