PDA

View Full Version : Cross-compile Qwt for WinCE 6



vix
10th October 2017, 09:43
I successfully built Qwt 6.1.3 for Windows platform using VS2008.
Now I need to cross-compile Qwt for WinCE 6; I found some threads on this forum, but I can't uderstand how to do it exactly.
The basic problem is that I'm not an expert and I downloaded a pre-built version of Qt for WinCE (http://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/WinCE/Special/QT/qt-win-opensource-4.8.4-vs2008_Toradex_WinCE6_NO_GL.exe) directly from Toradex site.
I can create Qt application cross-compiled for WinCE 6 selecting the platform "Toradex_CE600 (ARMv4I)" inside VS2008, but honestly speaking I don't know what there is exactly "behind the scenes".

As far as I understand I need to instruct in some way qmake to cross-compile for the WinCE 6 target.
In this post (http://www.qtcentre.org/threads/60421-Cross-compile-Qwt-project-to-ARM-on-Windows?p=267793#post267793s) Uwe suggests

all you need to do is to do a "qmake -spec xxx qwt.pro", where xxx is the spec file with all the settings for the target device ( the same specs you have used for cross compiling your standalone application ).
but I don't know if this is true for WinCE too, and I don't know where to search for my .spec file.

I found this thread (http://www.qtcentre.org/threads/57361-Installing-Qwt-for-Win-CE) that it's more or less my situation, but it seems that the user vicacid didn't succeed in building.
Moreover I don't want to mess-up my Qwt build for Windows.
I would like having both of the builds on my PC (I have Qt 4.8.4 for x86 and WinCE 6, in different folders).

Could someone help, please?

Uwe
10th October 2017, 20:10
but I don't know if this is true for WinCE too, and I don't know where to search for my .spec file.
It should be part of your Qt installation.

When looking on my linux box I can see several spec files that seem to be for WinCE 6:

/disk1/qt/qt-everywhere-opensource-src-4.8.7/mkspecs/wince60standard-armv4i-msvc2005
/disk1/qt/qt-everywhere-opensource-src-4.8.7/mkspecs/wince60standard-x86-msvc2005
...

Have a look at your mkspecs directory to see, which one matches your environment best.

Uwe

vix
11th October 2017, 07:55
Hello Uwe,
thank you very much for your help.

I looked inside my Qt installation (mkspecs directory) and I found several folders for several environment.
I think the best one for my need is <wince60colibri-armv4i-msvc2008>.
Inside this folder there are three files:

deafult_post.prf
qmake.conf
qplatformdefs.h


Which one is exactly the "spec" file I need?
I would have expected a file with .spec extension.

If I understood I sould call

qmake -spec <specfile> qwt.pro

Am I right?

vix
13th October 2017, 13:02
I used the following command

c:\qt\4.8.4\bin\qmake.exe -spec c:\qt\4.8.4\mkspecs\wince60colibri-armv4i-msvc2008 qwt.pro
where


c:\qt\4.8.4\bin\qmake.exe is the full path to WinCE build of Qt

c:\qt\4.8.4\mkspecs\wince60colibri-armv4i-msvc2008 is the whole path to platform and compiler information, as explained here (http://doc.qt.io/qt-5/qmake-running.html)


The generated Makefile seems ok to me (I can't attach because I get "invalid file" message).

When I launch
nmake install in a VS2008 command prompt, the compilation starts, but then I get the following error


Generating Code...
linking ..\lib\qwtd.dll
debug\qwt_abstract_scale_draw.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'THUMB'
NMAKE : fatal error U1077: 'echo' 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.

Which is the reason of this error?

Uwe
14th October 2017, 16:12
Obviously the object file has not been built for arm ( see X86 ). Maybe disable "CONFIG += silent" in qwtbuild.pri and check the commands being used for compiling.

Uwe

vix
16th October 2017, 08:22
I did it, but I can't find any problem.
I attached the generated Makefile and the output from
nmake install.

Uwe
16th October 2017, 10:10
The attached output is from a build in silent mode and does not show the relevant information.

Uwe

vix
17th October 2017, 16:57
The output has been produced after having disabled "CONFIG += silent" in qwtbuild.pri.
When "CONFIG += silent" was enabled, the output had less information.

How can I produce an output with more information?

Uwe
17th October 2017, 18:48
Try a "make distclean" so that the Makefile is definitely recreated and check that yout IDE does not add the silent option.

Uwe

vix
18th October 2017, 07:58
I tried "nmake distclean" and I verified that the Makefile is deleted.
The Makefile is recreated when I run "c:\qt\4.8.4\bin\qmake.exe -spec c:\qt\4.8.4\mkspecs\wince60colibri-armv4i-msvc2008 qwt.pro"

The problem is that no matter if "CONFIG += silent" in qwtbuild.pri is enabled or disabled (with a "#" character at the beggining of the line), the generated Makefile is the same.
Is this ok?

I run "nmake install" from a VS2008 command prompt and so I don't use a IDE. So I don't think a silent option is added.

What else should I check?

vix
25th October 2017, 16:25
I had to give up the "command line" way to build Qwt and examples for WinCE 6.
In case someone is interested, I've been able to successfully build them in the follow way:

Windows Desktop target: open qwt.pro with QtCreator and build
WinCE 6 target: use VS2008 with Qt Visual Studio Add-in and open the same qwt.pro. This creates the .sln and .vcproj files that need some minor manual modifications before building