I'm trying to use methods contained in a shared library (libscplugin.so
).
I have satisfied all of the libraries requirements:
libc.so
with a symlink tolibc.so.6
libz.so
with a symlink tolibz.so.1.2.8
libstdc++.so
with a symlink tolibstdc++.so.6.0.20
Upon compilation I get the following error message:
$ gcc test.c -o test -L/usr/lib/arm-linux-gnueabihf/ -lscplugin
/usr/bin/ld: test: hidden symbol `stat' in /usr/lib/arm-linux-gnueabihf/libc_nonshared.a(stat.oS) is referenced by DSO
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
The only reference I could find to libc_nonshared.a
is in /usr/lib/arm-linux-gnueabihf/libc.so
:
$ cat libc.so
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( /lib/arm-linux-gnueabihf/libc.so.6 /usr/lib/arm-linux-gnueabihf/libc_nonshared.a AS_NEEDED ( /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 ) )
In test.c
I'm attempting to use two functions of the shared library (totally unrelated to stat
). What can I do to get this to compile ?