Nuand / bladeRF

bladeRF USB 3.0 Superspeed Software Defined Radio Source Code
http://nuand.com
Other
1.15k stars 459 forks source link

libusb detection fails when x-compiling for Android #401

Closed mambrus closed 6 years ago

mambrus commented 9 years ago

When cross-compiling for Android detecting libusb will fail. Instead of detecting the correct one or ending up here https://github.com/Nuand/bladeRF/blob/master/host/libraries/libbladeRF/CMakeLists.txt#L189

...the hosts libusb is found instead. Build log follows (only last lines):

:
:
[ 26%] Building C object libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/src/backend/dummy.c.o
Linking C shared library ../../output/libbladeRF.so
/home/xxxx/usr/local/android-ndk-r10d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /usr/local/lib/libusb-1.0.so: incompatible target
collect2: error: ld returned 1 exit status
make[2]: *** [output/libbladeRF.so.1] Error 1
make[1]: *** [libraries/libbladeRF/CMakeFiles/libbladerf_shared.dir/all] Error 2
make: *** [all] Error 2
jynik commented 9 years ago

This doesn't occur when I'm building libbladeRF for ARM with Yocto, via the bladeRF recipes in meta-sdr.

I'll look to get you the following from that build, so we can compare and contrast.

rtucker commented 6 years ago

Closing this issue, as there's been no activity in a number of years. If you or anyone else experiences issues w/ building on Android (or even a success, heh...) please let us know.

Thanks :)