Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qtserialport on Win CE 6 with Qt 4.8.4
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,
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:
thanks for the link.
I am a little confused about the paths given in http://qt-project.org/wiki/QtSerialPort.
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 "qtserialport.pro", it is located in the top-level-folder. This does not fit to "qmake ../serialport-src/qtserialport.pro" 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.
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 "qtserialport.pro". 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 "qtserialport.pro" file!
Please do instructions how do compile on WinCE by URL to Qt-BugTracker that I'm give above...
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.
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
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?
bq. However in the “serialport-build/src/serialport” folder there is only a build for debug.
For Release may need do:
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.. :)
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 WINCEIO.zip with which it may be possible to test IO. Maybe you could attach it, so I can test the lib.
WINCEIO.zip sources was attached to their thread on Bug Tracker (please, look more attentively :) ).
Ok, I'm blind. Sorry....