Hi,
What should I do to compile Rodent (or any other console application chess program) for Android?
I am using Windows and Visual Studio 2017 community edition. Theoretically it should compile C++ code for ARM, but in practice I get a warning that I cannot compile a classic application for platform {0}
Any hints?
how to compile for Android
Moderators: hgm, Rebel, chrisw
-
- Posts: 893
- Joined: Mon Jan 15, 2007 11:23 am
- Location: Warsza
-
- Posts: 300
- Joined: Mon Apr 30, 2018 11:51 pm
Re: how to compile for Android
As far as I know, you cannot use Visual Studio for this. Android runs Linux; Visual Studio is Windows-only. You want the Android Native Development kit (and ideally a Linux machine—although the NDK can cross-compile, it's unlikely that the build system for any given engine will support that).
No matter what, be prepared to do a some porting work.
No matter what, be prepared to do a some porting work.
-
- Posts: 893
- Joined: Mon Jan 15, 2007 11:23 am
- Location: Warsza
Re: how to compile for Android
Theoretically, compiling under Windows for Android should be possible. The warning I mentioned can be solved by changing vcproject file (see https://pete.akeo.ie/2017/05/compiling- ... -with.html caveat #2), now I get a linker error about the wrong machine (LNK 1112).
Pawel Koziol
http://www.pkoziol.cal24.pl/rodent/rodent.htm
http://www.pkoziol.cal24.pl/rodent/rodent.htm
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: how to compile for Android
Compiling for ARM (= a processor architecture) is not the same as compiling for Android (= a version of Linux that runs on ARM).PK wrote: ↑Mon Jul 23, 2018 7:31 pm Theoretically, compiling under Windows for Android should be possible. The warning I mentioned can be solved by changing vcproject file (see https://pete.akeo.ie/2017/05/compiling- ... -with.html caveat #2), now I get a linker error about the wrong machine (LNK 1112).
In particular, I'm quite sure that Windows RT binaries and Windows 10 on ARM binaries won't run on Android.
-
- Posts: 2488
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: how to compile for Android
You can cross-compile under Windows using the NDK: https://developer.android.com/ndk/guide ... _toolchain
However, there are additional issues with C++ where you have a lot of STLs to choose from (I would expect most of the options not to work). On top of that, it looks like Rodent is using CPU dependent code with SSE3, which will probably give another rounds of headache. And stuff like wordexp.h which NDK doesn't find, or at least my installation fails to do so.
However, there are additional issues with C++ where you have a lot of STLs to choose from (I would expect most of the options not to work). On top of that, it looks like Rodent is using CPU dependent code with SSE3, which will probably give another rounds of headache. And stuff like wordexp.h which NDK doesn't find, or at least my installation fails to do so.
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: how to compile for Android
Apparently Wine includes some support for ARM:
https://wiki.winehq.org/ARM
But I have little doubt that trying to get an ARM Windows binary to work on Android using Wine is a much greater headache than rewriting the engine to be portable.
https://wiki.winehq.org/ARM
But I have little doubt that trying to get an ARM Windows binary to work on Android using Wine is a much greater headache than rewriting the engine to be portable.
-
- Posts: 2488
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: how to compile for Android
Especially since that seems already to be the case with Rodent where the website says (under downloads) "source code ready to be compiled under Linux".
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
- Posts: 300
- Joined: Mon Apr 30, 2018 11:51 pm
Re: how to compile for Android
Presumably that's Linux/glibc, not Linux/Bionic, but yes, trying to make a Windows ARM binary and getting it to run on Android is a losing game here.