Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Compiling for Android on Windows

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Compiling for Android on Windows
Eric Johnson
Member #14,841
January 2013
avatar

Let's forget Cygwin; I now have MSYS. I'm still fairly new to this, so please excuse my obtuse nature.

{"name":"al_004.PNG","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/d\/8d766b40e0a3cd6fe046b1f4e472d3b3.png","w":677,"h":283,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/d\/8d766b40e0a3cd6fe046b1f4e472d3b3"}al_004.PNG

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

MSYS gives you a basic unix shell, and ~ is your home directory. You need to cd to the correct directory first, presumably your build directory, and then you do something like this :

cd /c/allegro/android/build
cmake -G "MinGW Makefiles" [BUILD OPTIONS] ..

MinGW Makefiles should work with MSYS as well as MSYS Makefiles, but that will build Windows libraries instead of *nix ones (not sure which you need for Android).

Replace [BUILD OPTIONS] with your build options, obviously, like -DSHARED=off or -DCMAKE_BUILD_TYPE=Release.

Trent Gamblin
Member #261
April 2000
avatar

Use the same command you use in your last Cygwin post, but ADD the -G.

Eric Johnson
Member #14,841
January 2013
avatar

Before I continue, I just want to say that I am incredibly appreciative of everyone who has contributed to this particular topic. ;D Now then, I tried it again, yet the errors persist. Almost there!

{"name":"al_005.PNG","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/c\/5c70f005737d204cb506f332cbaf2ad8.png","w":677,"h":583,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/c\/5c70f005737d204cb506f332cbaf2ad8"}al_005.PNG

I have a few questions:

  1. Does the above command look correct?

  2. Does my directory look correct?

  3. What is your favorite color?

  4. I am using Allegro 5.1.7; is this O.K.?

  5. My build directory should be within my Allegro directory, correct?

Trent Gamblin
Member #261
April 2000
avatar

It should work if you ADD -DCMAKE_EXECUTABLE_SUFFIX=".exe". I would highly recommend you upgrade to Allegro git though. This particular fix is in there. There are other fixes too. If you don't want to upgrade, at least build WITHOUT the Android native image loader (probably best to do so even if you do upgrade because I haven't tested if it's truly fixed.) To do that you'll need to compile libpng for Android (and libjpeg if you need it.) I'm not sure the best way to do the next step in 5.1.7, but one sure way is to remove the lines in addons/image/CMakeLists.txt for Android that have "HAVE_LIBPNG", "HAVE_LIBJPEG" etc. Remove that whole group of statements. Sorry I can't be more specific. I'd really just recommend you download Allegro git and build libpng/jpeg (if you need them.)

Eric Johnson
Member #14,841
January 2013
avatar

I downloaded Allegro from GIT, took your advice, yet am still having issues--I'm terrible with Window's command line and really prefer Ubuntu Linux. I may just scrap Windows from this machine and go strictly Ubuntu soon. I'll look into this now.

Thanks for all of your help though. I'll make a new topic or will reply/update this one if I need help in the future. Godspeed.

 1   2 


Go to: