Compiling wxWinCE for Windows Mobile 5.0 (PocketPC and Smartphone)
Build wxWinCE 2.8 for Windows Mobile 5 with Visual Studio 2005
- you should have installed the smart device compilers for C++ in your visual studio installation. if not insert the install cd and add them
- download and install activesync (xp) or mobile device center (vista) from microsoft web site (search "mobile device center", ex: http://www.microsoft.com/downloads/details.aspx?FamilyID=46f72df1-e46a-4a5f-a791-09f07aaa1914&displaylang=en) if not already installed
- download and install mobile 5 sdk from microsoft web site : (search "mobile 5 sdk", ex: http://www.microsoft.com/DownLoads/details.aspx?FamilyID=83a52af2-f524-4ec5-9155-717cbe5d25ed&displaylang=en)
- download the last rc at http://biolpc22.york.ac.uk/pub (ex: 2.8.10-rc2/wxMSW-2.8.10-rc2.zip)
- if needed modify include/wx/msw/setup.h
- in vs2005 open build/wince/wx.vcw and convert it to vs2005 project
- compile it (twice if pb with clthumb.exe)
- copy built libraries from "build\wince\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\Debug" to "lib\evc_armv4t_lib\winced"
- open samples/minimal project, choose windows mobile 5 platform, and correct the libraries names and path in project properties
Build the wxWinCE libraries
You will need wxWidgets 2.6.3 RC2 or later to create Windows Mobile 5.0-specific applications or Pocket PC 2003 applications that will work correctly on Windows Mobile 5.0.
To build Windows Mobile 5.0-specific applications you need Visual Studio 2005, which costs money, but to build Pocket PC or Smartphone 2003 applications that will also run on Windows Mobile 5.0 devices, you only need Embedded Visual C++ 4.0, which is free. This section assumes you are using Visual Studio 2005.
Before compiling wxWidgets, install VS 2005 and download and install the required SDKs: Windows Mobile 5.0 Pocket PC and/or Windows Mobile 5.0 Smartphone. Be sure to install these BEFORE you open any wxWidgets projects.
Open build/wince/wx.vcw in VS 2005. It will prompt you to convert all project files, convert them. When the conversion finishes, VS 2005 should list 6 'Solutions' in the Solutions Explorer ( gl, mono, wxexpat, wxjpeg, wxpng, wxzlib). You will need to adjust setting in each of those projects to make it compile. To change the properties for each project in the workspace, Right-click on the project, and select "Properties". In the tree on the left side, go to "Configuration Properties | Librarian | General | Output File", and edit it so it reads (for example) ..\..\lib\$(PlatformName)\$(ConfigurationName)\wx_mono.lib.
Set under C/C++/Precompiled Header the value of Create/Use Precompiled Header to Not Using Procompiled Header (only under workspace gl and mono).
Then set the current configuration to the desired one (for example, Windows Mobile 5.0 Pocket PC) and compile each project. You may get some strange errors about a missing clthumb command but try again with F7 and eventually it will compile (only if you forget the precompiled header option).
Build a sample program
Now, open and convert a sample project, for example samples/minimal. Again, you will need to adjust some properties. In the project properties, edit "Linker | General | Additional Library Directories" so it includes "..\..\lib\$(PlatformName)\$(ConfigurationName)". Also change "Linker | Input | Additional Dependencies" property to something like: coredll.lib wx_mono.lib wx_wxjpeg.lib wx_wxpng.lib wx_wxzlib.lib wx_wxexpat.lib commctrl.lib winsock.lib wininet.lib
Now set the configuration, compile, and run the project. The emulator runs ARM applications directly so in VS 2005 there is no need to build separately for emulation.
If you receive unresolved symbol errors having to do with 'eh vector destructor iterator', your project probably depends upon runtime type information. You can solve the problem by adding ccrtrtti.lib to "Linker | Input | Additional Dependencies"
For new projects make sure you include the wxWidgets rc file wx/msw/wx.rc in your project's rc file. If you dont include it, you will get exceptions when creating the Menubar. 
Compiling wxWinCE for Windows Mobile 2003 (PocketPC)
These instructions are only meant to be a complimentary guide to the official wxWinCE installation documentation which can be found at "docs/msw/wince/readme.txt" or online (2.8). Please read all of the official documentation first.
Note : These are the steps I followed to get minimal and one of my own apps to compile and run on an iPAQ 4150.
First, you must download and install all of the following (in this order):
- eMbedded Visual C++ 4.0
- Service Pack 4 for eVC4
- Developer Resources for Windows Mobile 2003 Second Edition
- SDK for Windows Mobile 2003-based Pocket PCs
Then download and extract wxWidgets 2.6.x for Windows zip file from : http://www.wxwidgets.org/.
Rebuild wxWidgets for WinCE as follows:
- Open C:\wxWinCE\build\wince\wx.vcw
- Rebuild each of the six projects in the ClassView by right clicking on the project, selecting "Set as Active Project", and selecting Rebuild from the Build menu.
Now you can open the minimal sample (minimal.vcw) and rebuild that.
If you wish to create your own project then these are the steps I followed to create a project and import an existing wxWidgets application.
- File | New | Projects | "WCE Pocket PC 2003 Application"
- Enter project name and location.
- Choose "An empty project"
- Click Finish
- Select OK
- Project | Add to project | Files
- Add all of the required files to the project.
- <Alt F7>
- C/C++ | Precompiled Headers | Not using precompiled headers
- C/C++ | Preprocessor | Preprocessor definitions
- C/C++ | Preprocessor | Additional include directories:
- Link | Object/library modules:
- coredll.lib wxwince25d.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib winsock.lib wininet.lib
- Link | Additional library path
Compiling wxWinCE for Windows CE 3.0 (PocketPC)
- Download and install Embedded Visual Tools 3.0 2002 if you don't already have it
- download package and get CD Key from http://www.microsoft.com/downloads/details.aspx?FamilyId=F663BF48-31EE-4CBE-AAC5-0AFFD5FB27DD&displaylang=en
- if you want to use emulator feature on off-line computer read and follow http://www.pocketpcdn.com/articles/emulator_loopback.html
- Download wxWidgets from CVS (head), daily snapshots here
- If Project files now are not in the CVS (yet?), they must be generated with bakefile, see docs/tech/tn0016.txt for more information. You may choose the CPU(s) for which you want to include the configurations in the project file. The emulator configuration is always included.
- (2004-11-18) The project files in the CVS snapshot are stored with linux linefeeds. You must re-save them with windows linefeeds.
- One way to convert the linefeeds in the vcw/vcp files is to follow these steps:
- Open each file with the Visual Studio .NET IDE
- On the File menu, select "Advanced Save Options"
- Change the "Line endings" combo box to "Windows (CR LF)"
- Click "Ok"
- On the File menu, select "Save"
- One way to convert the linefeeds in the vcw/vcp files is to follow these steps:
- Open build/wince/wx.vcw, select the appropriate configuration ("WIN32 (WCE emulator) Debug" if using an emulator or another), close the dialog, then select Pocket PC 2002 and Pocket PC 2002 Emulation on the toolbar, and compile. There may be long delays while VC++ computes dependencies, and expect to wait a long time for loading and saving the workspace.
- Open samples/minimal/minimal.vcw, select the same configuration as was used for building the library and build.
The setup file for wxWinCE is in include/wx/msw/wince/setup.h. Some features are currently switched off for the port to compile but most of them are available.
Compiling wxWinCE for Windows CE 4.x (embedded platforms)
- Download and install Embedded Visual C++ 4.0 here http://www.microsoft.com/downloads/details.aspx?FamilyID=1dacdb3d-50d1-41b2-a107-fa75ae960856&displaylang=en
- Download and install eMbedded Visual C++ 4.0 SP3 here http://www.microsoft.com/downloads/details.aspx?familyid=5bb36f3e-5b3d-419a-9610-2fe53815ae3b&displaylang=en
- Follow the same instructions as above
� see also below
Step-byStep instructions to build wxWinCE.NET
1. Get bakefile binaries
- NOTE: in lack of workspace and project files for eVC IDE in source tree of wxWidgets you should build them yourself using Bakefile.
Homepage : http://bakefile.sourceforge.net
- Installer for Windows. The package is self-contained, you don't have to install Python separately, small version of Python 2.3 runtime is included.
Download : http://bakefile.sourceforge.net/download.php
2. Bakefile and Python installation
- Download and install bakefile-0.1.4-setup.exe
- Add bakefile to %PATH% or call it with full path when required
(for example) C:\Programmi\Bakefile\src\bakefile_gen
3. Prepare Bakefiles.bkgen for eVC++4
- Edit build\bakefiles\Bakefiles.bkgen and remove the word "msevc4prj" (without quotes) from
<disable-formats> section directive, like this:
3. Generate Bakefiles for eVC++4
- md %WXWIN%\build\wince <= VERY IMPORTANT !
- cd %WXWIN%\build\bakefiles
- C:\Programmi\Bakefile\src\bakefile_gen -f msevc4prj
Note that last step builds over 100 project files. Save your time and use -b parameter to build selected files.
Now you have the .VCW file in %WXWIN%\build\wince
4. Build using eVC++4
- open workspace %WXWIN%/build/wince/wx.vcw (Marco and Julian tried with eVC4, ABX tried with eVC3)
- (VC8 works but the project import doesn't preserve output libary names or paths so you'll have to massage sample project files a bit)
- select type of build (debug/unicode)
- select target
- In sequence build
- open workspace in one of samples folder
- select the same settings for type of build and target
- build (and run if targeted to emulator)
If you get error LNK1166, browse to this page and search for LNK1166 (It's written for eVC++4 but applies to VC8 as well)