A
A
Antony2014-12-10 08:06:45
linux
Antony, 2014-12-10 08:06:45

How to build Qt5 for cross-compilation from Linux to Windows?

Actually the essence of the question - I'm trying to compile Qt5.3.2 in order to collect programs for Windows from under Linux. When compiling, I run into errors that I do not understand.
I configure like this:

./configure -xplatform win32-g++ -prefix /opt/qt5win32 -device-option CROSS_COMPILE=i686-w64-mingw32- -nomake examples -nomake tools -static -continue  -qt-sql-sqlite

And when compiling, it gives some annoying errors:
spoiler

/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:12:2: ошибка: #error No __uuidof support for this targetIn file included from /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comdef.h:169:0,
from qwindowscontext.cpp:80:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:12:2: ошибка: #error No __uuidof support for this target
...
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h: В функции-члене «long int _com_ptr_t<_IIID>::CreateInstance(const CLSID&, IUnknown*, DWORD)»:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:202:56: ошибка: «typeof» не имеет аргументов, зависящих от параметра-шаблона, поэтому должна быть доступна декларация «typeof» [-fpermissive]
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:202:56: замечание: (с ключом «-fpermissive», G++ примет данный код, но разрешение использовать недекларированные имена будет отменено в дальнейших версиях)
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:202:56: ошибка: argument in position «1» is not a potential constant expression
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:202:56: ошибка: parse error in template argument list
In file included from /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comdef.h:169:0,
from qwindowscontext.cpp:80:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h: В функции-члене «int _com_ptr_t<_IIID>::_CompareUnknown(_InterfacePtr)»:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:299:49: ошибка: «typeof» не имеет аргументов, зависящих от параметра-шаблона, поэтому должна быть доступна декларация «typeof» [-fpermissive]
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:299:49: ошибка: argument in position «1» is not a potential constant expression
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:299:49: ошибка: parse error in template argument list
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:306:38: ошибка: «typeof» не имеет аргументов, зависящих от параметра-шаблона, поэтому должна быть доступна декларация «typeof» [-fpermissive]
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:306:38: ошибка: argument in position «1» is not a potential constant expression
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:306:38: ошибка: parse error in template argument list
In file included from /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comdef.h:169:0,
from qwindowscontext.cpp:80:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h: В функции-члене «long int _com_ptr_t<_IIID>::CreateInstance(const CLSID&, IUnknown*, DWORD)»:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:202:56: ошибка: «typeof» не имеет аргументов, зависящих от параметра-шаблона, поэтому должна быть доступна декларация «typeof» [-fpermissive]
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:202:56: замечание: (с ключом «-fpermissive», G++ примет данный код, но разрешение использовать недекларированные имена будет отменено в дальнейших версиях)
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:202:56: ошибка: argument in position «1» is not a potential constant expression
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:202:56: ошибка: parse error in template argument list
In file included from /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comdef.h:169:0,
from qwindowscontext.cpp:80:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h: В функции-члене «int _com_ptr_t<_IIID>::_CompareUnknown(_InterfacePtr)»:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:299:49: ошибка: «typeof» не имеет аргументов, зависящих от параметра-шаблона, поэтому должна быть доступна декларация «typeof» [-fpermissive]
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:299:49: ошибка: argument in position «1» is not a potential constant expression
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:299:49: ошибка: parse error in template argument list
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:306:38: ошибка: «typeof» не имеет аргументов, зависящих от параметра-шаблона, поэтому должна быть доступна декларация «typeof» [-fpermissive]
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:306:38: ошибка: argument in position «1» is not a potential constant expression
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/comip.h:306:38: ошибка: parse error in template argument list


What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey Savostin, 2014-12-10
@savostin

Try mxe .
And yes, webkit* is not statically linked

D
Demonist, 2015-01-25
@Demonist

Armenian Radio is right - the compiler is too old. On version MinGW 4.8.2 everything compiled without problems.

A
Armenian Radio, 2014-12-10
@gbg

Either your compiler is too old, or -static gets in the way.
QT 5.3.2 is built dynamically for cross-compilation.

D
DancingOnWater, 2014-12-10
@DancingOnWater

But what if, when configuring, you try to explicitly indicate that C ++ 11 is not used?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question