Cross compilation issue

For code related discussions and questions
Post Reply
JrmyR
Greenhorn
Posts: 14
Joined: 28 Aug 2013, 18:32

Cross compilation issue

Post by JrmyR » 19 Feb 2017, 06:54

Hello guys,

I'm trying to cross compile the WZ 3.2.1 release from archlinux.

(The compilation for linux works, I can play the game.)

I followed the instructions here http://developer.wz2100.net/wiki/Compil ... dows/Cross, but I got an error relative to QtPlatformSupport :

Code: Select all

/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lQt5PlatformSupport
collect2: error: ld returned 1 exit status
The full stack trace :

Code: Select all

make[3] : on entre dans le répertoire « /documents/warzone2100/warzone2100-3.2.1/src »
i686-w64-mingw32.static-g++ -g -Wno-enum-compare -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wcast-align -Wwrite-strings -Wpointer-arith -Wno-format-security -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtWidgets -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtGui -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtScript -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore -I/mxe/usr/i686-w64-mingw32.static/qt5/include   -DQT_STATICPLUGIN -pipe -m32 -march=i686 -O2 -g -gstabs -g3 -fno-exceptions -fPIC -std=c++11 -fstack-protector  -lz -Wl,-subsystem,windows  -fPIC -o warzone2100.exe action.o advvis.o ai.o animobj.o astar.o atmos.o aud.o baseobject.o bridge.o bucket3d.o challenge.o cheat.o clparse.o cluster.o cmddroid.o combat.o component.o configuration.o console.o data.o design.o difficulty.o display3d.o display.o drive.o droid.o edit3d.o effects.o feature.o fpath.o frontend.o game.o gateway.o geometry.o group.o hci.o ingameop.o init.o intdisplay.o intelmap.o intimage.o intorder.o keybind.o keyedit.o keymap.o level_lexer.o levels.o lighting.o loadsave.o loop.o main.o map.o mapdisplay.o mapgrid.o mechanics.o message.o miscimd.o mission.o move.o multibot.o multigifts.o multiint.o multijoin.o multilimit.o multimenu.o multiopt.o multiplay.o multistat.o multistruct.o multisync.o objects.o objmem.o oprint.o order.o pointtree.o power.o projectile.o qtscript.o qtscriptdebug.o qtscriptfuncs.o radar.o random.o raycast.o research.o scores.o scriptai.o scriptcb.o scriptextern.o scriptfuncs.o scriptobj.o scripttabs.o scriptvals.o scriptvals_lexer.o scriptvals_parser.o selection.o seqdisp.o stats.o structure.o template.o terrain.o text.o texture.o transporter.o version.o visibility.o warcam.o warzoneconfig.o wavecast.o wrappers.o multiint_moc.o qtscriptdebug_moc.o ../lib/widget/libwidget.a ../lib/sequence/libsequence.a ../lib/sound/libsound.a ../lib/script/libscript.a ../lib/netplay/libnetplay.a ../lib/ivis_opengl/libivis_opengl.a ../lib/gamelib/libgamelib.a ../lib/exceptionhandler/libexceptionhandler.a ../3rdparty/miniupnpc/libminiupnpc.a ../3rdparty/quesoglc/libquesoglc.a  ../lib/sdl/libsdl.a ../lib/framework/libframework.a -lintl -liconv -L/mxe/usr/i686-w64-mingw32.static/lib -lmingw32 -lSDL2main -lSDL2 -mwindows  -Wl,--no-undefined -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -static-libgcc   -lphysfs -L/mxe/usr/i686-w64-mingw32.static/lib -lpng16 -lz   -lvorbisfile -lvorbis -L/mxe/usr/i686-w64-mingw32.static/lib -logg -lm   -lvorbis -L/mxe/usr/i686-w64-mingw32.static/lib -logg -lm   -ltheora -L/mxe/usr/i686-w64-mingw32.static/lib -logg   -L/mxe/usr/i686-w64-mingw32.static/lib -lOpenAL32  -lwinmm -luuid -lole32   -lfribidi -lglib-2.0 -lws2_32 -lole32 -lwinmm -lshlwapi -L/mxe/usr/i686-w64-mingw32.static/lib -lpcre -lintl -liconv    -lharfbuzz -lcairo -lgobject-2.0 -lfontconfig -lusp10 -lmsimg32 -lgdi32 -lpixman-1 -L/mxe/usr/i686-w64-mingw32.static/lib/../lib -lffi -lexpat -lfreetype -lbz2 -lpng16 -lz -lharfbuzz_too -lglib-2.0 -lws2_32 -lole32 -lwinmm -lshlwapi -L/mxe/usr/i686-w64-mingw32.static/lib -lpcre -lintl -liconv    -lharfbuzz -lcairo -lgobject-2.0 -lfontconfig -lusp10 -lmsimg32 -lgdi32 -lpixman-1 -L/mxe/usr/i686-w64-mingw32.static/lib/../lib -lffi -lexpat -lfreetype -lbz2 -lpng16 -lz -lharfbuzz_too -lglib-2.0 -lws2_32 -lole32 -lwinmm -lshlwapi -L/mxe/usr/i686-w64-mingw32.static/lib -lpcre -lintl -liconv   -lpthread -lopengl32 -lglu32 -L/mxe/usr/i686-w64-mingw32.static/lib -lGLEW -lopengl32 -lglu32   -lopengl32 -lglu32 -L/mxe/usr/i686-w64-mingw32.static/qt5/plugins/platforms -lQt5PlatformSupport -lqwindows -lQt5Widgets -lQt5Gui -lQt5Script -lQt5Core /mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Gui.a -luxtheme -ldwmapi -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lopengl32 -lpng16 -lharfbuzz -L/mxe/usr/i686-w64-mingw32.static/qt5/lib /mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmpr -lwinmm -lz -lpcre16    -L/mxe/usr/i686-w64-mingw32.static/lib -lGLEW -lopengl32 -lglu32     -L/mxe/usr/i686-w64-mingw32.static/lib -lcrypto -lws2_32 -lgdi32 -lcrypt32 -lz   -lz -Wl,-subsystem,windows  -fPIC ../win32/warzone2100.o  -lbfd -ldbghelp -lshfolder -lshlwapi -lpsapi -lshell32 -lwinmm -lws2_32 -liphlpapi -lz -lintl -liconv -liberty -lstdc++ 
/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lQt5PlatformSupport
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:897: warzone2100.exe] Error 1
make[3] : on quitte le répertoire « /documents/warzone2100/warzone2100-3.2.1/src »
make[2]: *** [Makefile:819: all] Error 2
make[2] : on quitte le répertoire « /documents/warzone2100/warzone2100-3.2.1/src »
make[1]: *** [Makefile:586: all-recursive] Error 1
make[1] : on quitte le répertoire « /documents/warzone2100/warzone2100-3.2.1 »
make: *** [Makefile:506: all] Error 2
So looks like I'm missing libQt5PlatformSupport from mxe.
Is there a way to force mxe to provide this lib?

Edit : Tried with Debian and got the same issue.

Regards
Last edited by JrmyR on 26 Feb 2017, 18:22, edited 1 time in total.

User avatar
andrvaut
Trained
Trained
Posts: 112
Joined: 02 Jan 2016, 12:44

Re: Cross compilation issue

Post by andrvaut » 22 Feb 2017, 10:43

I have a probblem too
vaut ΣΑ [GN], ru streamer.
Tournaments channel: https://www.youtube.com/channel/UCzusNa-54ydodtSz2TdHFww

JrmyR
Greenhorn
Posts: 14
Joined: 28 Aug 2013, 18:32

Re: Cross compilation issue

Post by JrmyR » 25 Feb 2017, 17:36

You mean the same one?

User avatar
andrvaut
Trained
Trained
Posts: 112
Joined: 02 Jan 2016, 12:44

Re: Cross compilation issue

Post by andrvaut » 28 Feb 2017, 22:56

Sorry, qt5 installed. The problem was a year ago, and then I did not succeed. Under new manual and with a new version of mingw no problems.

Bat v3.2.1 not compile:

Code: Select all

Making all in lib/widget
make[2]: Entering directory '/home/vitya/warzone/wzgit/warzone2100/lib/widget'
i686-w64-mingw32.static-g++ -DHAVE_CONFIG_H -I. -I../..  -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/include/SDL2  -Dmain=SDL_main   -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNDEBUG -DWZ_DATADIR="\"/usr/local/share/warzone2100\"" -DLOCALEDIR="\"/usr/local/share/locale\"" -I../.. -I../../3rdparty -I../../3rdparty/quesoglc -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtWidgets -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtGui -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtScript -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include    -g -Wno-enum-compare -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wcast-align -Wwrite-strings -Wpointer-arith -Wno-format-security -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtWidgets -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtGui -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtScript -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore -I/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include   -pipe -m32 -march=i686  -g -gstabs -g3 -fPIC -std=c++11 -fstack-protector -MT editbox.o -MD -MP -MF .deps/editbox.Tpo -c -o editbox.o editbox.cpp
editbox.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 /*
 ^
editbox.cpp: In member function 'void W_EDITBOX::insertChar(QChar)':
editbox.cpp:127:9: error: ambiguous overload for 'operator==' (operand types are 'QChar' and 'char')
  if (ch == '\0')
         ^
In file included from /home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/QString:1:0,
                 from ../../lib/framework/wzglobal.h:537,
                 from ../../lib/framework/frame.h:26,
                 from editbox.cpp:26:
/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qstring.h:1624:13: note: candidate: bool operator==(const QString&, QChar)
 inline bool operator==(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return   rhs == lhs; }
             ^
/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qstring.h:1566:20: note: candidate: bool operator==(const QString&, const QStringRef&)
 Q_CORE_EXPORT bool operator==(const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW;
                    ^
/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qstring.h:1632:13: note: candidate: bool operator==(QChar, const QStringRef&)
 inline bool operator==(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
             ^
/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qstring.h:1613:13: note: candidate: bool operator==(QChar, const QString&)
 inline bool operator==(QChar lhs, const QString &rhs) Q_DECL_NOTHROW
             ^
In file included from /home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qstring.h:48:0,
                 from /home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/QString:1,
                 from ../../lib/framework/wzglobal.h:537,
                 from ../../lib/framework/frame.h:26,
                 from editbox.cpp:26:
/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qchar.h:573:30: note: candidate: constexpr bool operator==(QChar, QChar)
 Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs == c2.ucs; }
                              ^
editbox.cpp: In member function 'void W_EDITBOX::overwriteChar(QChar)':
editbox.cpp:153:9: error: ambiguous overload for 'operator==' (operand types are 'QChar' and 'char')
  if (ch == '\0')
         ^
In file included from /home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/QString:1:0,
                 from ../../lib/framework/wzglobal.h:537,
                 from ../../lib/framework/frame.h:26,
                 from editbox.cpp:26:
/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qstring.h:1624:13: note: candidate: bool operator==(const QString&, QChar)
 inline bool operator==(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return   rhs == lhs; }
             ^
/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qstring.h:1566:20: note: candidate: bool operator==(const QString&, const QStringRef&)
 Q_CORE_EXPORT bool operator==(const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW;
                    ^
/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qstring.h:1632:13: note: candidate: bool operator==(QChar, const QStringRef&)
 inline bool operator==(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
             ^
/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qstring.h:1613:13: note: candidate: bool operator==(QChar, const QString&)
 inline bool operator==(QChar lhs, const QString &rhs) Q_DECL_NOTHROW
             ^
In file included from /home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qstring.h:48:0,
                 from /home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/QString:1,
                 from ../../lib/framework/wzglobal.h:537,
                 from ../../lib/framework/frame.h:26,
                 from editbox.cpp:26:
/home/vitya/warzone/wzgit/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore/qchar.h:573:30: note: candidate: constexpr bool operator==(QChar, QChar)
 Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs == c2.ucs; }
                              ^
Makefile:507: recipe for target 'editbox.o' failed
vaut ΣΑ [GN], ru streamer.
Tournaments channel: https://www.youtube.com/channel/UCzusNa-54ydodtSz2TdHFww

JrmyR
Greenhorn
Posts: 14
Joined: 28 Aug 2013, 18:32

Re: Cross compilation issue

Post by JrmyR » 06 Mar 2017, 18:47

To solve your issue you can edit editbox.cpp and replace the two '\0' occurrences by QChar('\0').

The libQt5PlatformSupport issue come after this one.

User avatar
andrvaut
Trained
Trained
Posts: 112
Joined: 02 Jan 2016, 12:44

Re: Cross compilation issue

Post by andrvaut » 07 Mar 2017, 21:34

in master fix QChar
but

Code: Select all

/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lQt5PlatformSupport
vaut ΣΑ [GN], ru streamer.
Tournaments channel: https://www.youtube.com/channel/UCzusNa-54ydodtSz2TdHFww

JrmyR
Greenhorn
Posts: 14
Joined: 28 Aug 2013, 18:32

Re: Cross compilation issue

Post by JrmyR » 11 Mar 2017, 21:26

Same issue so

User avatar
vexed
Inactive
Inactive
Posts: 2471
Joined: 27 Jul 2010, 02:07

Re: Cross compilation issue

Post by vexed » 12 Mar 2017, 06:32

Downgrade Qt to 5.5.
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.

User avatar
andrvaut
Trained
Trained
Posts: 112
Joined: 02 Jan 2016, 12:44

Re: Cross compilation issue

Post by andrvaut » 15 Mar 2017, 22:11

Hi.
I fix linker bug this bad patch.
and drastically fix encoding problem.
Attachments
dirtypatch.diff
(6.75 KiB) Downloaded 88 times
vaut ΣΑ [GN], ru streamer.
Tournaments channel: https://www.youtube.com/channel/UCzusNa-54ydodtSz2TdHFww

JrmyR
Greenhorn
Posts: 14
Joined: 28 Aug 2013, 18:32

Re: Cross compilation issue

Post by JrmyR » 22 Mar 2017, 03:10

Your patch works fine :)

Thank you !

Post Reply