Game Development Reference
In-Depth Information
-g -Wall -DX11 -fpic -o sys_linux.o -c
/home/user/workspace/Android.Quake/native/Doom/sys_linux.c
cc1: warnings being treated as errors
/home/user/workspace/Android.Quake.Preview/native/Quake/sys_linux.c:
In function 'floating_point_exception_handler':
/home/user/workspace/Android.Quake.Preview/native/Quake/sys_linux.c:350:
error: implicit declaration of function 'sysv_signal'
This error is thrown because of a difference in the naming convention of the C system call signal
(used to bind a user-defined function to an OS signal) between the toolchain (which implements the
system call as signal), and the Android implementation ( sysv_signal ).
Regarding missing symbols, if you build a shared library, the compiler will not choke when there are
missing subroutines or variables within your code. This will ultimately cause the library not to load once
the program starts. I found this difficult to deal with, as the tools to work with native code are
cumbersome and difficult to use, especially for the newcomer. I have used a simple solution, which is to
build a mini main program to invoke the shared library, as demonstrated in Chapter 2.
An Android Compilation Script
Listing 1-2 shows the bash script to aid in Android compilation, called agcc .
Listing 1-2. Compilation Helper Script (agcc)
#!/bin/bash
#############################################
# Android Compilation helper script
# Uses the CodeSourcery G++ Toolchain for ARM
#############################################
#############################################
# Root folder where files are installed
# Update this to match your system
#############################################
HOME=/home/user
# JVM location. Set to your location
JAVA_HOME=/usr/lib/jvm/java-6-sun
# Device system image
SYS_ROOT=$HOME/tmp/android/system
# Android source code
SYS_DEV=$HOME/mydroid
# Code Sourcery Toolchain location
TOOLCHAIN_ROOT=$HOME/Desktop/android/arm-2008q3
Search WWH ::




Custom Search