Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » android building using Android.mk

This thread is locked; no one can reply to it. rss feed Print
android building using Android.mk
anthony61
Member #17,067
April 2019

Hello,

I have existing application for android, it is written in java and c++, I like to have it more portable, so I want rewrite some java parts to c++. My java code is mostly about simple graphics like create scaled bitmap, draw text or simple primitives to bitmap. I did not know that exists such great library like is allegro, it has everything what I need for porting.

I downloaded sources from github. I have android studio 3.3 and ndk 19 on linux. I though I can simply open gradle_project from allegro5/android folder in android studio and compile, but seems no, I get this error :

Could not get unknown property 'GRADLE_PROJECT' for settings 'gradle_project' of type org.gradle.initialization.DefaultSettings.

Can someone help me? Is this correct way how to build ".so" files?
Many thanks

*originally I wanted to ask for building with android.mk files, but I do not need it. Would be sufficient build ".so" files which I can include to project.

EDIT: i am following steps in README_android, i executed commands:

mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-android.cmake
-DCMAKE_BUILD_TYPE=Debug
-DANDROID_TARGET=android-15
-DARM_TARGETS=armeabi-v7a
make
make install

, however I failed in make

In file included from /home/UX/ahornacekux/AndroidStudioProjects/allegro5/src/tls.c:49:
In file included from /home/UX/ahornacekux/AndroidStudioProjects/allegro5/include/allegro5/internal/aintern_android.h:7:
/home/UX/ahornacekux/AndroidStudioProjects/allegro5/include/allegro5/allegro_opengl.h:128:10: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>
^~~~~~~~~
1 error generated.
CMakeFiles/allegro.dir/build.make:1118: recipe for target 'CMakeFiles/allegro.dir/src/tls.c.o' failed

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: