Cross-Compile STK on Linux with MinGW | Issue

Cross-Compile STK on Linux with MinGW | Issue

Postby PT400C » 12 May 2019, 08:57

Hello,

when trying to compile STK with MinGW on Debian9 for Windows-64, I encounter lots of errors within the Irrlicht lib.

Example 1:
{l Code}: {l Select All Code}
lib/irrlicht/CMakeFiles/stkirrlicht.dir/build.make:138: recipe for target 'lib/irrlicht/CMakeFiles/stkirrlicht.dir/source/Irrlicht/CBoneSceneNode.cpp.obj' failed
make[2]: *** [lib/irrlicht/CMakeFiles/stkirrlicht.dir/source/Irrlicht/CBoneSceneNode.cpp.obj] Error 1
In file included from /usr/supertux/stk-code/lib/irrlicht/source/Irrlicht/CAttributes.cpp:6:0:
/usr/supertux/stk-code/lib/irrlicht/source/Irrlicht/CAttributeImpl.h: In member function ‘virtual irr::core::stringw irr::io::CUserPointerAttribute::getStringW()’:
/usr/supertux/stk-code/lib/irrlicht/source/Irrlicht/CAttributeImpl.h:2022:33: error: ‘_snwprintf’ was not declared in this scope
   swprintf(buf, 32, L"%p", Value);


Example 2:
{l Code}: {l Select All Code}
lib/irrlicht/CMakeFiles/stkirrlicht.dir/build.make:113: recipe for target 'lib/irrlicht/CMakeFiles/stkirrlicht.dir/source/Irrlicht/CBillboardSceneNode.cpp.obj' failed
make[2]: *** [lib/irrlicht/CMakeFiles/stkirrlicht.dir/source/Irrlicht/CBillboardSceneNode.cpp.obj] Error 1
In file included from /usr/supertux/stk-code/lib/irrlicht/include/matrix4.h:14:0,
                 from /usr/supertux/stk-code/lib/irrlicht/include/IAttributes.h:18,
                 from /usr/supertux/stk-code/lib/irrlicht/source/Irrlicht/CAttributes.h:8,
                 from /usr/supertux/stk-code/lib/irrlicht/source/Irrlicht/CAttributes.cpp:5:
/usr/supertux/stk-code/lib/irrlicht/include/irrString.h: In instantiation of ‘irr::core::string<T, TAlloc>::string(double) [with T = wchar_t; TAlloc = irr::core::irrAllocator<wchar_t>]’:
/usr/supertux/stk-code/lib/irrlicht/source/Irrlicht/CAttributeImpl.h:171:37:   required from here
/usr/supertux/stk-code/lib/irrlicht/include/irrString.h:109:11: error: ‘_snprintf’ was not declared in this scope
   snprintf(tmpbuf, 255, "%0.6f", number);


Any idea what could be wrong with these parts of irrlicht? And what did I do wrong?

Thanks in advance

PT400C
PT400C
 
Posts: 7
Joined: 01 May 2019, 09:11

Re: Cross-Compile STK on Linux with MinGW | Issue

Postby Auria » 13 May 2019, 22:59

We do not officially support cross-compiling so I'm afraid you're going off the beaten path here and we won't be able to provide much help, unfortunatley
Image
User avatar
Auria
STK Moderator
 
Posts: 2972
Joined: 07 Dec 2009, 03:52

Re: Cross-Compile STK on Linux with MinGW | Issue

Postby deve » 14 May 2019, 12:54

Assuming that you have g++-mingw-w64 and gcc-mingw-w64 installed, and you have "dependencies" directory (the same as for normal mingw compilation on windows) you can just use:
{l Code}: {l Select All Code}
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw-64bit.cmake
make

I was doing it multiple times on ubuntu and I think that it should work on debian in the same way. I can check on debian buster later.

The only thing is that on some mingw versions 32bit complation fails when building angelscript, so maybe better use 64bit version.
deve
 
Posts: 252
Joined: 23 Jan 2014, 13:45

Re: Cross-Compile STK on Linux with MinGW | Issue

Postby deve » 14 May 2019, 22:25

I just checked and 64-bit compilation works without issues on debian buster using mingw from repositories.

For 32-bit compilation it still needs this patch:
https://github.com/supertuxkart/stk-cod ... a0d03fb7e4
deve
 
Posts: 252
Joined: 23 Jan 2014, 13:45

Who is online

Users browsing this forum: No registered users and 1 guest