Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » compiling for android

This thread is locked; no one can reply to it. rss feed Print
compiling for android
William Labbett
Member #4,486
March 2004
avatar

Quote:

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler
"C:/android-ndk-r7-windows/android-ndk-r7/toolchains/x86-4.4.3/prebuilt/windows/i686-android-linux/bin/gcc.exe"
is not able to compile a simple test program.

This is what I got when configuring CMake.

Obviously I've installed the ndk to C:/android-ndk-r7-windows .

I definitely downloaded the windows ndk but it's got the word linux everywhere.

What I'd like to know is if the compiler can't compile because it's the wrong one or whether there's something else I need to do..

Appreciate any help.

Peter Wang
Member #23
April 2000

Have a look in CMakeFiles/CMakeError.log and CMakeFiles/CMakeOutput.log

Note that as of right now the Android port does not compile. You will need to revert back to r15152 or earlier.

Trent Gamblin
Member #261
April 2000
avatar

Is that because of the opengl changes I recently made? Do I have to boot up the desktop and fix it?

William Labbett
Member #4,486
March 2004
avatar

Normally we type : svn co https://alleg.svn.sourceforge.net/svnroot/alleg/allegro/branches/5.1

How do we specify the revision to download ?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

svn help checkout said:

c:\ctwoplus\progcode\allegro5>svn help checkout
checkout (co): Check out a working copy from a repository.
usage: checkout URL[@REV]... [PATH]

If specified, REV determines in which revision the URL is first
looked up.

If PATH is omitted, the basename of the URL will be used as
the destination. If multiple URLs are given each will be checked
out into a sub-directory of PATH, with the name of the sub-directory
being the basename of the URL.

If --force is used, unversioned obstructing paths in the working
copy destination do not automatically cause the check out to fail.
If the obstructing path is the same type (file or directory) as the
corresponding path in the repository it becomes versioned but its
contents are left 'as-is' in the working copy. This means that an
obstructing directory's unversioned children may also obstruct and
become versioned. For files, any content differences between the
obstruction and the repository are treated like a local modification
to the working copy. All properties from the repository are applied
to the obstructing path.

See also 'svn help update' for a list of possible characters
reporting the action taken.

Valid options:
-r [--revision] ARG : ARG (some commands also take ARG1:ARG2 range)
A revision argument can be one of:
NUMBER revision number
'{' DATE '}' revision at start of the date
'HEAD' latest in repository
'BASE' base rev of item's working copy
'COMMITTED' last commit at or before BASE
'PREV' revision just before COMMITTED
-q [--quiet] : print nothing, or only summary information
-N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--force : force operation to run
--ignore-externals : ignore externals definitions

Global options:
--username ARG : specify a username ARG
--password ARG : specify a password ARG
--no-auth-cache : do not cache authentication tokens
--non-interactive : do no interactive prompting
--trust-server-cert : accept SSL server certificates from unknown
certificate authorities without prompting (but only
with '--non-interactive')
--config-dir ARG : read user configuration files from directory ARG
--config-option ARG : set user configuration option in the format:
FILE:SECTION:OPTION=[VALUE]
For example:
servers:global:http-library=serf

c:\ctwoplus\progcode\allegro5>

So it looks like

svn co URL[@15152]

will work. Haven't tried it though.

Maybe

svn co -r 15152 URL

too.

Peter Wang
Member #23
April 2000

Is that because of the opengl changes I recently made?

Yeah.

#SelectExpand
1/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c: In function 'ogl_lock_region': 2/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:669: warning: implicit declaration of function 'glGetTexImage' 3/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:681: error: 'GL_FRAMEBUFFER_BINDING_EXT' undeclared (first use in this function) 4/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:681: error: (Each undeclared identifier is reported only once 5/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:681: error: for each function it appears in.) 6/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:684: warning: implicit declaration of function 'glBindFramebufferEXT' 7/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:684: error: 'GL_FRAMEBUFFER_EXT' undeclared (first use in this function) 8/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c: In function 'ogl_unlock_region': 9/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:823: warning: implicit declaration of function 'glWindowPos2i' 10/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:837: warning: implicit declaration of function 'glRasterPos2f' 11/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:842: warning: implicit declaration of function 'glDrawPixels' 12/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:890: error: 'GL_UNPACK_ROW_LENGTH' undeclared (first use in this function) 13/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:941: warning: unused variable 'tex_internalformat' 14/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c: In function 'al_remove_opengl_fbo': 15/home/tjaden/ahack/ws_4.9/src/opengl/ogl_bitmap.c:1167: warning: implicit declaration of function 'glDeleteFramebuffersEXT'

Maybe it's just a matter of OES vs EXT suffixes, or a missing #ifdef ALLEGRO_ANDROID somewhere.

Thomas Fjellstrom
Member #476
June 2000
avatar

Actually, It seems the largest problem is the use of GL_UNPACK_ROW_LENGTH, there is no such thing in the NDK. We need to do without that somehow, as who knows if it's actually supported by the OpenGL on android devices.

append: All fixed. She compiles and runs. Now I think I'll work on the fs access stuff some more.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

William Labbett
Member #4,486
March 2004
avatar

Back again,

in my ndk toolchain I've found 4 possibilities for what I could set

CMAKE_C_COMPILER to :

C:\android-ndk-r7-windows\android-ndk-r7\toolchains\x86-4.4.3\prebuilt\windows\i686-android-linux\bin\gcc

C:\android-ndk-r7-windows\android-ndk-r7\toolchains\x86-4.4.3\prebuilt\windows\bin\i686-android-linux-gcc

C:\android-ndk-r7-windows\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\arm-linux-androideabi\bin\gcc

C:\android-ndk-r7-windows\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-gcc

Any idea which one I should use ?

Thomas Fjellstrom
Member #476
June 2000
avatar

None. Please follow the directions in the readme. The Allegro cmake code is setup to use a "standalone toolchain", which you create by running a script thats part of the ndk. Also I suggest using --platform=android-14 rather than -9. It does NOT mean that it only supports Android 4, just that it can support android 4.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

William Labbett
Member #4,486
March 2004
avatar

Okay. Thanks for that :)

Those instructions are under the "Building on Linux" header so I didn't think they applied to what I was doing since I'm on Win7.

After I ran the script I get this from CMake :

Check for working C compiler: C:/android-toolchain/bin/arm-linux-androideabi-gcc
CMake Error: your C compiler: "C:/android-toolchain/bin/arm-linux-androideabi-gcc" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed

Quote:

C:\android-toolchain\bin>dir
Volume in drive C has no label.
Volume Serial Number is 007E-67DA

Directory of C:\android-toolchain\bin

09/01/2012 17:53 <DIR> .
09/01/2012 17:53 <DIR> ..
08/01/2012 20:38 630,784 arm-linux-androideabi-addr2line.exe
08/01/2012 20:38 651,264 arm-linux-androideabi-ar.exe
08/01/2012 20:38 1,082,368 arm-linux-androideabi-as.exe
08/01/2012 20:38 259,072 arm-linux-androideabi-c++.exe
08/01/2012 20:38 630,272 arm-linux-androideabi-c++filt.exe
08/01/2012 20:38 257,536 arm-linux-androideabi-cpp.exe
08/01/2012 20:38 259,072 arm-linux-androideabi-g++.exe
08/01/2012 20:38 254,976 arm-linux-androideabi-gcc-4.4.3.exe
08/01/2012 20:38 254,976 arm-linux-androideabi-gcc.exe
08/01/2012 20:38 123,904 arm-linux-androideabi-gcov.exe
08/01/2012 20:38 2,534,912 arm-linux-androideabi-gdb.exe
08/01/2012 20:38 701,952 arm-linux-androideabi-gprof.exe
08/01/2012 20:38 1,070,080 arm-linux-androideabi-ld.exe
08/01/2012 20:38 642,048 arm-linux-androideabi-nm.exe
08/01/2012 20:38 816,128 arm-linux-androideabi-objcopy.exe
08/01/2012 20:38 962,560 arm-linux-androideabi-objdump.exe
08/01/2012 20:38 651,264 arm-linux-androideabi-ranlib.exe
08/01/2012 20:38 311,296 arm-linux-androideabi-readelf.exe
08/01/2012 20:38 761,856 arm-linux-androideabi-run.exe
08/01/2012 20:38 632,320 arm-linux-androideabi-size.exe
08/01/2012 20:38 632,320 arm-linux-androideabi-strings.exe
08/01/2012 20:38 816,128 arm-linux-androideabi-strip.exe
22 File(s) 14,937,088 bytes
2 Dir(s) 118,809,616,384 bytes free

C:\android-toolchain\bin>

Evidently it's there in the directory, so I'm not sure why it's not finding it.

** edit **

I tried following the instructions word for word (ie using the command line) but I get the same message about the compiler not being found :-/

Thomas Fjellstrom
Member #476
June 2000
avatar

I guess I should have tested on windows. It is there, but cmake is looking for a file without an extension. Ooops. I'm booting up my desktop for another project anyhow, I'll try and fix that asap.

append: Me again. I've committed a fix that should fix that error.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

William Labbett
Member #4,486
March 2004
avatar

Cool.... ...but isn't the SVN version not working with android at the moment ?

Thanks what Peter Wang said.

Thomas Fjellstrom
Member #476
June 2000
avatar

Cool.... ...but isn't the SVN version not working with android at the moment ?

You probably missed the edit on my second last post. I fixed it yesterday.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Neil Walker
Member #210
April 2000
avatar

I feel your pain, I've spent all afternoon just trying to install ADT. All I get from Eclipse is random conflicting plugins, and it's even doing this for updates to plugins I already have. I just want to know why Elipse is just so shit with plug-ins. I mean, it installed the previous plugins I had and now it's telling me it can't update but it won't let me uninstall in order to start from scratch.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

William Labbett
Member #4,486
March 2004
avatar

Fab.

Thomas Fjellstrom
Member #476
June 2000
avatar

I managed to get eclipse working for android dev. But found it too slow, bloated, and laggy. And a lot of other people didn't want to be tied into eclipse for working on Allegro stuff, so I made it so it'd work with the console stuff. To be honest, I'm not sure how it'd work with eclipse as it's currently set up. It would probably need an eclipse project made up for it.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Neil Walker
Member #210
April 2000
avatar

Is there an allegro port for android :o

I've started using this: libgdx (http://libgdx.badlogicgames.com/).

It's a cross-platform java library to target android, linux, windows (
there's a very good tutorial here http://chrismweb.com/2011/10/18/how-to-start-creating-android-games-using-the-libgdx-game-development-framework/) if anyone wants to compare it with whatever they are using.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Thomas Fjellstrom
Member #476
June 2000
avatar

Is there an allegro port for android

It's not 100% working, but yes. I have a little bit of work to do on the image addon, but then at least you'll be able to display stuff more interesting than primitives. After that I'll do the audio addon.

The nice thing is that your Allegro 5 apps will be mostly portable between the Desktop, iOS and Android once it's all done. There will be some changes needed due to the differences of the desktop and small form factor platforms, but it should all be fairly small changes (mostly input and screen size related).

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Go to: