Important: Please read the Qt Code of Conduct -

Qtserialport on Win CE 6 with Qt 4.8.4

  • Hi!

    I am trying to add qtserialport to Qt 4.8.4 for the use on a Windows CE 6 device, a Toradex Colibri T20. Host machine is a Win7 PC with VS2008. The Qt library was built statically with

    configure -static -platform win32-msvc2005 -xplatform wince60standard-armv4i-msvc2008

    and works well.

    To build qtserialport I followed the instructions given here:

    but can't build successfully. Additionaly to the instructions given I executed:

    set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\include;C:\Program Files (x86)\Windows CE Tools\wce600\Colibri600\Include\Armv4i

    set LIB=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\lib\armv4i;C:\Program Files (x86)\Windows CE Tools\wce600\Colibri600\Lib\ARMV4I

    set PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\ce\bin\x86_arm;%PATH%

    It produces an fatal error from LINK1112 module machine type 'X86' conflicts with target machine type'THUMB'. I know what the error means, but don't know how to resolve it. Where can I configure the cross-platform build?
    Maybe there is an additional problem, because Qt was built statically?

    Thanks for your help,

  • Qt Champions 2020


    Nobody did static build of QtSerialPort because it was designed and tested only as shared with shared Qt compiled. Please yourself investigate for trying build as static, and then please give here HowTo. :)

    Here this build process precisely works in case of dynamic Qt and dynamic QtSerialPort:

  • Hi kuzulls,
    thanks for the link.

    I am a little confused about the paths given in
    I don't have a folder "serialport-src" but only a folder "src" which contains a folder "serialport" which then contains the sourcecode. In neither there's a project file "", it is located in the top-level-folder. This does not fit to "qmake ../serialport-src/" given in the installation instructions.
    I tried different variants for the path of the "build" folder and qmake, but was unsuccessful.

    It would be great if somebody could give me a hint.

    Regards, vicacid.

  • Qt Champions 2020

    bq. I don’t have a folder “serialport-src” but only a folder “src” ...

    A "serialport-src" is meant (is a name) as top-level directory, that contains a project file "". You can do rename your top-level directory to “serialport-src” (or do not rename :) ). Simply it can have other name which depends on a way of receiving an source code (through Git, or through WEB). In any case, it is necessary to use "" file!

    Please do instructions how do compile on WinCE by URL to Qt-BugTracker that I'm give above...

  • Hi kuzulis,
    thanks for the hint. Now it builds correctly and I can include qtserialport into my code.
    One last step is still missing. How do I tell my VS2008 project (using Qt addin) that I want to use qtserialport? If I generate a .pro file and add serialport to CONFIG, it has no effect.

    Regards, vicacid.

  • Qt Champions 2020

    Add-in broken a project at building, may it is some Add-in bug or something else.

    I created VS projects without Add-in, using console command:

    qmake -tp vc /path/to/your/project/file

    e.g. see:

    But, before should be installed a Env paths to Qt-wince and MSVC ARM compilers by analogy as when Qt is building.

    If I am not mistaken. I did it long ago and all forgot.

  • Thanks again, kuzulis.

    I got it to work in the following way:
    First, I added QtSerialPort.lib to the linker input in the VS project settings. Then I could compile the example code, but could not deploy the application to the Win CE device.
    So I copied QtSerialPortd.dll onto the device manually and then it works. I can get information about the existing serial ports with QSerialPortInfo.

    However in the "serialport-build/src/serialport" folder there is only a build for debug. In the release folder there's solely the file QtSerialPort.prl.
    Not a problem by now, but maybe something wrong in a makefile?

    Regards, Stephan.

  • Qt Champions 2020

    bq. However in the “serialport-build/src/serialport” folder there is only a build for debug.

    For Release may need do:

    qmake CONFIG+=release

    but I'm not sure. In any case, please try investigate this issue yourself, and at successful result please give/display solution. Because I not have a WinCE and do not have a time for this.. :)


  • Hi kuzulis,
    the library now works on my device. I can read out the settings of the COM-Port etc. and send data from the device to the host PC.
    My hopefully last problem is reading data from the host. serial. readAll() does not return anything and waitForDataReady() produces time outs.
    With Windows routines IO works in both directions, so the hardware etc. is ok.

    I saw you have a with which it may be possible to test IO. Maybe you could attach it, so I can test the lib.

    Thanks, Stephan

  • Qt Champions 2020

    @vicacid, sources was attached to their thread on Bug Tracker (please, look more attentively :) ).

    Here is a URL:

  • Ok, I'm blind. Sorry....

Log in to reply