Android build fails?
Posted: Sat Jul 08, 2017 1:02 am
Hi,
I'm trying to make an Android compile of my C engine under Win7. I got the Android NDK and used that included Python script to make a standalone toolchain.
I want to simply use the GCC like I'm also using the MingW GCC, from a build batch file. So I'm calling GCC with a bunch of C files all at once, a lot of compiler options and the -o option to tell what output file I want.
That works also nicely for the bare metal GCC I'm using for the build for my microcontroller target platform. No need to set any special paths or stuff. However, the Android NDK is behaving completely differently.
Things compile nicely, all headers are found. Since I've set -Werror, unknown functions would already cause the compilation to fail.
The issue now is that I'm running into linker problems: undefined references to stuff from the C standard library. I guess that either I have to configure something to the PATH variable, possibly right in the build batch file, or that I have to add some -ldunnowhat to the compiler call to get some libraries added.
On a second question, my engine is allocating around 230 MB for the hash tables on startup. I want to support also older Android devices, e.g. the Galaxy S4 mini has something like 1.5 GB RAM.
What amount of available RAM can I reasonably expect, assuming that also MP3 playback may be going on, a browser in the background, and of course some xboard-protocol capable chess GUI running?
I'm trying to make an Android compile of my C engine under Win7. I got the Android NDK and used that included Python script to make a standalone toolchain.
I want to simply use the GCC like I'm also using the MingW GCC, from a build batch file. So I'm calling GCC with a bunch of C files all at once, a lot of compiler options and the -o option to tell what output file I want.
That works also nicely for the bare metal GCC I'm using for the build for my microcontroller target platform. No need to set any special paths or stuff. However, the Android NDK is behaving completely differently.
Things compile nicely, all headers are found. Since I've set -Werror, unknown functions would already cause the compilation to fail.
The issue now is that I'm running into linker problems: undefined references to stuff from the C standard library. I guess that either I have to configure something to the PATH variable, possibly right in the build batch file, or that I have to add some -ldunnowhat to the compiler call to get some libraries added.
Code: Select all
C:\Users\ras\AppData\Local\Temp\ccpdbTSL.o: In function `Play_Xboard':
play.c:(.text+0xc40): undefined reference to `signal'
play.c:(.text+0x1bd4): undefined reference to `stdout'
play.c:(.text+0x1bd8): undefined reference to `stdin'
C:\Users\ras\AppData\Local\Temp\ccpdbTSL.o: In function `main':
play.c:(.text.startup+0x118): undefined reference to `srand'
play.c:(.text.startup+0x1f4): undefined reference to `stdout'
C:\Users\ras\AppData\Local\Temp\cccu1wsd.o: In function `Book_Is_Line':
book.c:(.text+0x624): undefined reference to `rand'
C:\Users\ras\AppData\Local\Temp\cc5GGOKD.o: In function `Search_Get_Best_Mov
e':
search.c:(.text+0x3f04): undefined reference to `stdout'
collect2.exe: error: ld returned 1 exit status
On a second question, my engine is allocating around 230 MB for the hash tables on startup. I want to support also older Android devices, e.g. the Galaxy S4 mini has something like 1.5 GB RAM.
What amount of available RAM can I reasonably expect, assuming that also MP3 playback may be going on, a browser in the background, and of course some xboard-protocol capable chess GUI running?