I have a compiled library (without source) for a fingerprint driver. I'm sure it's an ARM compilation because the command file mylib.so
says:
ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped
but if I want use them in a C++ program I have always the same error:
error while loading shared libraries: mylib.so: cannot open shared object file: No such file or directory
this error like you see it's not very explicit, of course i have used the export command on the variable LD_LIBRARY_PATH with the path of mylib.so.
so, How to known if a ARM library (.so) is compatible with the raspberry PI ?
-- Edit --
ldd libsgfdu03.so:
not a dynamic executable
ldd libsgfdu04.so:
not a dynamic executable
ldd libsgfpamx.so:
not a dynamic executable
In the SDK, with the .so
, I have a sample C++ program to manage the driver. With two commands for compile in one makefile:
g++ -I./ -I../include -c main.cpp
--> include one file named "sgfplib.h"
g++ /usr/lib/arm-linux-gnueabihf/libusb.so -lpthread -lsgfpamx
-lsgfdu03 -lsgfplib -o ../bin/arm12/sgfplibtest_fdu03 main.o -L/home/pi/sdk/lib/arm12
All the paths are good and no error is reported at compile time, but after ldd
on the final executable ldd sgfplibtest_fdu03
says:
/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6f76000)
libusb-0.1.so.4 => /lib/arm-linux-gnueabihf/libusb-0.1.so.4 (0xb6f5a000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6f3b000)
libsgfpamx.so => not found
libsgfdu04.so => not found
libsgfplib.so => not found
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6e6e000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6dfd000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6dd5000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6ca6000)
/lib/ld-linux-armhf.so.3 (0xb6f83000)
-- Edit same driver with debian x86 --
dpkg -S libsgfpamx.so
dpkg-query: no path found matching pattern *libsgfpamx.so*
ldd sgfplibtest_fdu03 :
linux-gate.so.1 => (0xb76eb000)
libusb-0.1.so.4 => /lib/libusb-0.1.so.4 (0xb76d1000)
libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb76b8000)
libsgfpamx.so => /usr/local/lib/libsgfpamx.so (0xb769d000)
libsgfdu03.so => /usr/local/lib/libsgfdu03.so (0xb7632000)
libsgfplib.so => /usr/local/lib/libsgfplib.so (0xb7623000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7536000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7510000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb74f1000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb73aa000)
/lib/ld-linux.so.2 (0xb76ec000)
The same exe (but compiled for x86) does not seem to required nothing more. I'm totally lost ....
ldd mylib.so
and see what comes out – Lawrence Sep 06 '13 at 01:04ldd
is a good way to tell. Note that there is not just one ARM architecture -- the pi is ARM11, aka. ARMv6, and there is an ARMv7 (Cortex) which is not compatible. I do not know of an easy way to tell the executables apart though. – goldilocks Sep 07 '13 at 12:27