PDA

View Full Version : Strange output: Can't compile for WinCE to save my life!



codeslicer
17th February 2010, 18:14
By now I've recompiled Qt for various source packages and for various builds, but I just can't seem Qt to compile for a mobile device. (It compiles fine for Win32).

Here's what I did:


Installed the latest Qt package for msvc2008 in C:\Qt\4.6.2\ and also ActivePerl.
Created new folder in C:\Qt\4.6.2-mobile\
Created a \bin in that folder and added it to PATH sys environment variable (My Computer... etc)
Opened up MSVS Command Prompt, and cd'd to C:\Qt\4.6.2-mobile
ran:
C:\Qt\4.6.2\configure -platform win32-msvc2008 -xplatform wincewm60professional-msvc2008 -nomake examples -nomake demos -no-qt3support -no-webkit -no-phonon -no-phonon-backend -release
ran:
setcepaths wincewm60professional-msvc2008 && nmake
Compiles successfully
Now I go to my existing project (G:\Qt\winceapp\WinCEApp.pro, a simple QMainWindow program with 1 button that does nothing) and open up MSVS Command prompt, cd to it, and type
qmake && nmake (the manual method to compile for WinCE according to the docs). Compiles succesfully... but when I copy that + QtCore.dll + QtGui.dll (from C:\Qt\4.6.2-mobile\libs) I get that it's not a valid Pocket PC application.
So I try "qmake -tp vc". I get a .vcproj file. Open that, go to Configuration Manager, change to "Release", create a <New> solution platform (copied settings from Win32) and changed to "Windows Mobile 6 Professional SDK (ARMV4I)" (check box checked).
Press F5, and get a bunch of errors:
1>------ Rebuild All started: Project: WinCEApp, Configuration: Release Windows Mobile 6 Professional SDK (ARMV4I) ------
1>Deleting intermediate and output files for project 'WinCEApp', configuration 'Release|Windows Mobile 6 Professional SDK (ARMV4I)'
1>MOC mainwindow.h
1>UIC mainwindow.ui
1>Compiling...
1>main.cpp
1>c:\qt\4.6.2\include\qtcore\../../src/corelib/arch/qatomic_windows.h(167) : warning C4163: '_InterlockedExchangeAdd64' : not available as an intrinsic function
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\crtdefs.h(106) : fatal error C1189: #error : ERROR: Use of C runtime library internal header file.
1>moc_mainwindow.cpp
1>c:\qt\4.6.2\include\qtcore\../../src/corelib/arch/qatomic_windows.h(167) : warning C4163: '_InterlockedExchangeAdd64' : not available as an intrinsic function
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\crtdefs.h(106) : fatal error C1189: #error : ERROR: Use of C runtime library internal header file.
1>mainwindow.cpp
1>c:\qt\4.6.2\include\qtcore\../../src/corelib/arch/qatomic_windows.h(167) : warning C4163: '_InterlockedExchangeAdd64' : not available as an intrinsic function
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\crtdefs.h(106) : fatal error C1189: #error : ERROR: Use of C runtime library internal header file.
1>Generating Code...
1>Build log was saved at "file://g:\Qt\winceapp\Windows Mobile 6 Professional SDK (ARMV4I)\Release\BuildLog.htm"
1>WinCEApp - 3 error(s), 3 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========



The Qt->Change project's Qt Version doesn't seem to do anything (and yes, I have added both versions to the list, and they are classified correctly). What I'm confused about is how Qt or nmake knows the project should be compiled for WINCE. Is there some entry that can be changed in the pro file?

So yeah... I'm kind of stumped. If anyone could help, that'd be great. :)

~codeslicer

codeslicer
17th February 2010, 20:06
Well, I decided to try something different. I created a new Qt Windows CE project, and that compiled beautifully. It seems qmake messed up on its file generation.

Anyways, now I just have to copy the settings and see what's up.

~codeslicer

codeslicer
17th February 2010, 21:01
Alright, it seems the main problem is that the WINCE flag was not set, which was one of the main issues. Reported to Nokia. If anyone has these problems, just open up two instances of Visual Studio. In one of them, create a new Qt Windows CE project, and in the other open up your project. Then go to Project->Settings for both of them and copy various settings as you see fit. The only problems I have are that deploy can't find the file and I have to copy some files from the build folder to the root of the project... but hey, at least it compiles! ;)

On a side note, does the GUI when compiled for Windows CE all look messed up? As in there is tiny font? What can be done about that?

So, P.S. if you're a mod, edit the title to say [SOLVED]. Thanks.

~codeslicer

codeslicer
20th February 2010, 15:55
Added a wiki page at http://wiki.qtcentre.org/index.php?title=Building_Qt_on_Windows_CE as the docs are not too specific.

~codeslicer