4
votes
LNK1112: module machine type ' X86' conflicts with target machine type 'THUMB'

I'm trying to build Qt for Windows CE/Windows Mobile and I'm following this guide: http://doc.qt.io/archives/4.6/install-wince.html

These are the steps I took so far:

  1. I downloaded qt-everywhere-opensource-src-4.6.3
  2. Extracted to C:\Qt\qt-everywhere-opensource-src-4.6.3
  3. Opened a Visual Studio command prompt and ran the following command configure -platform win32-msvc2008 -xplatform wincewm60professional-msvc2008 -webkit -openssl -arch windowsce -opensource -qt-gif -qt-libjpeg -qt-libpng
  4. The configure step finished successfully.
  5. I try to setcepaths wincewm60professional-msvc2008 and I get the following error

Could not find specified SDK: Windows Mobile 6 Professional SDK (ARMV4I)

'tmp_created_script_setup.bat' is not recognized as an internal or external command, operable program or batch file.

Could Not Find C:\Qt\qt-everywhere-opensource-src-4.6.3\tmp_created_script_setup .bat

Windows Mobile 6 Professional selected, environment is set up

This is probably my problem as if I type in checksdk -list I get this output

Available SDKs:
SDK Name: Pocket PC 2003 (ARMV4)
SDK Name: Smartphone 2003 (ARMV4)

For some reason, the Windows Mobile Professional 6.5 SDK is not detected, even though I can create, build and run Windows Mobile Professional 6.5 applications from Visual Studio 2008.

Nevertheless, the setcepaths command is supposed to set some environment variables to override the default Visual Studio include paths and include their Windows Mobile counterparts, so I went ahead, following the guide and set them myself to

set INCLUDE=C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include;C:\Program Files\Windows Mobile 6 SDK\PocketPC\Include\Armv4i
set LIB=C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\lib\armv4i;C:\Program Files\Windows Mobile 6 SDK\PocketPC\Lib\Armv4i
set PATH=C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\bin\x86_arm;%PATH%

With that in place, I try running nmake and then I'm struck with this error

C:\Qt\qt-everywhere-opensource-src-4.6.3>nmake

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cd src\winmain\ && "C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\
nmake.exe" -f Makefile

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        "C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" -f Makef
ile.Debug all

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        lib /SUBSYSTEM:WINDOWSCE,5.02 /MACHINE:THUMB /OUT:..\..\lib\qtmaind.lib
@C:\Users\AHMED~1.SAB\AppData\Local\Temp\nm6312.tmp
Microsoft (R) Library Manager Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.

tmp\obj\debug_shared\qtmain_win.obj
tmp\obj\debug_shared\qtmain_win.obj : fatal error LNK1112: module machine type '
X86' conflicts with target machine type 'THUMB'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\
bin\x86_arm\lib.EXE"' : return code '0x458'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
2

2 Answers

0
votes
  1. Download and install Qt SDK for Open Source C++ for Windows http://qt.nokia.com/downloads/sdk-windows-cpp
  2. Install Visual Studio.
  3. Install Visual Studio SP1.
  4. Install .Net Compact Framework.
  5. If OS is XP or earlier, install Microsoft Active Sync.
  6. If OS is Vista or later, install Windows Mobile Device Center.
  7. Install Windows Mobile 6 SDK.
  8. Download and extract Qt C++ WinCE SDK (eg. C:\Qt\QtWinCE).
  9. Download and install Qt C++ Windows for Visual Studio (eg. C:\Qt\QtVS2008).
  10. Install Qt Visual Studio add-in inside Qt WinCE folder and Qt C++ Windows for Visual Studio folder.
  11. Change the system environment variables:
    • set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\include;C:\Program Files (x86)\Windows Mobile 6 SDK\PocketPC\Include\Armv4i;
    • set LIB=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\lib\armv4i;C:\Program Files (x86)\Windows Mobile 6 SDK\PocketPC\Lib\Armv4i;
    • set QTDIR=C:\Qt\QtWinCE;C:\Qt\QtVS2008;C:\Qt\2010.02.1;C:\Qt\2010.02.1\qt;
    • set PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\bin\x86_arm;%PATH%;
  12. configure.
  13. setcepaths wincewm60professional-msvc2008
  14. nmake
0
votes

For what you said, you have no WM6 SDK.

SDK is here. See Qt for Windows CE Requirements referenced from Installing Qt for Windows CE.

  • Note that SDK 6.0 is not 6.5.