subsurface-mobile build error undefined reference to 'rand'
Lubomir I. Ivanov
neolit123 at gmail.com
Sun Jun 18 13:06:10 PDT 2017
On 17 June 2017 at 06:54, Rick Walsh <rickmwalsh at gmail.com> wrote:
> It turns out I might actually have a little bit of time to dedicate to
> Subsurface over the next couple of weeks, and I thought I'd start by
> reviving my Android build chain. Running packaging/android/build.sh, I get
> stuck with this error. Does anyone smarter than me know what's going on?
> I'm on Fedora 25, with android-ndk-r13b and Qt5.9.
> $ sh packaging/android/build.sh
> /home/rick/src/subsurface/libgit2-0.24.1/src/cache.c:117: error: undefined
> reference to 'rand'
sounds like it isn't linking against the platform libc.a. i doubt that
rand() is missing in the standard library implementation...maybe
wrapping another function but not missing.
you can try:
$ build.sh VERBOSE=1
to see what the linker is doing.
i haven't tried the Subsurface Android build script, but i get
something like the bellow from the "ndk-build" script when building a
generic test library:
.exe -Wl,-soname,libtesttest.so -shared
atforms/android-19/arch-arm testtest.o -lgcc -gcc-toolchain c:/bin/
64 -no-canonical-prefixes -target armv7-none-linux-androideabi -Wl,--fix-cortex-
a8 -Wl,--build-id -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
-Wl,--warn-shared-textrel -Wl,--fatal-warnings -lc -lm -o libtesttest.so
it tells me that it sets the platform location correctly (--sysroot)
and it links against -lc (rand()) should be part libc.a and libc.so).
it also sets the toolchain correctly (-gcc-toolchain) and -lgcc is
located in there.
More information about the subsurface