[Qt-interest] Cross-compiling Qt (linux -> windows)

Victor Leschuk vleschuk at gmail.com
Wed Sep 21 11:52:55 CEST 2011


Hello all,

I am trying to cross-compile Qt 4.7.4 from Linux x86_64 for Windows x86_64
using the following toolchain:

$ x86_64-w64-mingw32-g++ --version
x86_64-w64-mingw32-g++ (GCC) 4.5.4 20110822 (prerelease)

Found some articles/mails regarding this point int the web:

http://lists.trolltech.com/qt-interest/200...ead00351-0.html<http://lists.trolltech.com/qt-interest/2006-03/thread00351-0.html>
http://silmor.de/29 (also rather unclear to me part http://silmor.de/38 )

Most guys who did it recommend to build Qt libs on a windows host and than
put them to Linux host for linkage.

I also took a look at cross-compiliing Qt for embedded systems from official
docs.

I tried the following actions:

 - Edit win32-g++ qmake.conf: make it use my cross-compiler and add some
defines (-DWIN32 -DUNICODE)
 - ./configure -platform win32-g++ ....

After that I get an error

x86_64-w64-mingw32-g++ -c -o qfsfileengine_unix.o -DWIN32 -DUNICODE
-DQMAKE_OPENSOURCE_EDITION -g -I. -Igenerators -Igenerators/unix
-Igenerators/win32 -Igenerators/mac -Igenerators/symbian
-I/home/del/Downloads/qt/include -I/home/del/Downloads/qt/include/QtCore
-I/home/del/Downloads/qt/src/corelib/global
-I/home/del/Downloads/qt/src/corelib/xml
-I/home/del/Downloads/qt/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE
-DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT -DQT_NO_TEXTCODEC
-DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS
-I/home/del/Downloads/qt/mkspecs/win32-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD
-DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT
/home/del/Downloads/qt/src/corelib/io/qfsfileengine_unix.cpp
In file included from
/home/del/Downloads/qt/include/QtCore/private/qcore_unix_p.h:1:0,
from /home/del/Downloads/qt/src/corelib/io/qfsfileengine_unix.cpp:45:
/home/del/Downloads/qt/include/QtCore/private/../../../src/corelib/kernel/qcore_unix_p.h:59:3:
error: #error "qcore_unix_p.h included on a non-Unix system"
In file included from
/home/del/Downloads/qt/include/QtCore/private/qcore_unix_p.h:1:0,
from /home/del/Downloads/qt/src/corelib/io/qfsfileengine_unix.cpp:45:
/home/del/Downloads/qt/include/QtCore/private/../../../src/corelib/kernel/qcore_unix_p.h:66:22:
fatal error: sys/wait.h: No such file or directory
compilation terminated.
make: *** [qfsfileengine_unix.o] Error 1

It seems that configure scripts somehow detect that running host is unix and
use inappropriate defines and headers.

Did anyone manage to build Qt from Linux to Windows? If yes, please advice
what am I doing wrong?

Thanks in advance.

--
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110921/81d4a6c8/attachment.html 


More information about the Qt-interest-old mailing list