SoapyHackRF icon indicating copy to clipboard operation
SoapyHackRF copied to clipboard

Running `make` fails on Raspberry Pi

Open Kishaihd opened this issue 6 years ago • 10 comments

Running make on the Raspberry Pi fails with the following message:

Scanning dependencies of target HackRFSupport [ 16%] Building CXX object CMakeFiles/HackRFSupport.dir/HackRF_Registation.cpp.o /home/pi/SoapyHackRF/HackRF_Registation.cpp: In function std::vector<std::map<std::basic_string<char>, std::basic_string<char> > > find_HackRF(const Kwargs&)’: /home/pi/SoapyHackRF/HackRF_Registation.cpp:34:2: error: ‘hackrf_device_list_t’ was not declared in this scope hackrf_device_list_t *list; ^ /home/pi/SoapyHackRF/HackRF_Registation.cpp:34:24: error: ‘list’ was not declared in this scope hackrf_device_list_t *list; ^ /home/pi/SoapyHackRF/HackRF_Registation.cpp:36:27: error: ‘hackrf_device_list’ was not declared in this scope list =hackrf_device_list(); ^ /home/pi/SoapyHackRF/HackRF_Registation.cpp:46:44: error: ‘hackrf_device_list_open’ was not declared in this scope hackrf_device_list_open(list, i, &device); ^ /home/pi/SoapyHackRF/HackRF_Registation.cpp:99:30: error: ‘hackrf_device_list_free’ was not declared in this scope hackrf_device_list_free(list); ^ CMakeFiles/HackRFSupport.dir/build.make:62: recipe for target 'CMakeFiles/HackRFSupport.dir/HackRF_Registation.cpp.o' failed make[2]: *** [CMakeFiles/HackRFSupport.dir/HackRF_Registation.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/HackRFSupport.dir/all' failed make[1]: *** [CMakeFiles/HackRFSupport.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

Kishaihd avatar Jan 19 '18 03:01 Kishaihd

I've successfully done this before on Ubuntu, Kali, Arch Linux, and the Raspberry Pi. I don't know why I'm getting this error this time. Any insights?

Kishaihd avatar Jan 19 '18 03:01 Kishaihd

sounds like either its an older version of libhackrf missing certain api calls or somehow the project configured without finding hackrf includes. Can you share the output of cmake and the version of libhackrf?

guruofquality avatar Jan 19 '18 05:01 guruofquality

Might also try a 'sudo ldconfig' and start fresh with the build directory and clean cmake

unixpunk avatar Jan 19 '18 16:01 unixpunk

Here's the output of my cmake: -- The CXX compiler identification is GNU 4.9.2 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Build type not specified: defaulting to release. -- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") -- Found LIBHACKRF: /usr/lib/arm-linux-gnueabihf/libhackrf.so -- LIBHACKRF_INCLUDE_DIRS - /usr/include/libhackrf -- LIBHACKRF_LIBRARIES - /usr/lib/arm-linux-gnueabihf/libhackrf.so -- Performing Test HAS_STD_CXX11 -- Performing Test HAS_STD_CXX11 - Success -- Found Git: /usr/bin/git (found version "2.1.4") -- Module HackRFSupport configured with version: 0.3.3-bd1cf4d -- Configuring done -- Generating done -- Build files have been written to: /home/pi/SoapyHackRF/build

Kishaihd avatar Jan 20 '18 20:01 Kishaihd

I did try sudo ldconfig, but it didn't seem to make a difference.

Kishaihd avatar Jan 20 '18 20:01 Kishaihd

I did try sudo ldconfig, but it didn't seem to make a difference.

sudo ldconfig is more of a post install command on debian systems when you are installing shared libraries, doesnt really apply here.

Best I can tell, you have a really old version of libhackrf that doesnt have the device list api. You didnt share the version of libhackrf installed. But most likely the solution is to update libhackrf to a recent release.

guruofquality avatar Jan 20 '18 21:01 guruofquality

Shouldn't sudo apt-get update update libhackrf to the latest version? I've done that, as well as sudo apt-get upgrade and even sudo apt-get dist-upgrade. How do I check the version of libhackrf?

Kishaihd avatar Jan 20 '18 22:01 Kishaihd

Shouldn't sudo apt-get update update libhackrf to the latest version?

Not really. OSs tend to freeze most of their package repos with the release, with the exception of some packages, and important bug fixes. You have to update the OS usually. Thats one of the reasons for all of those backport PPAs on launchpad.

How do I check the version of libhackrf?

Check the version on the installed package from apt. The last 3 tags from 2015 and onwards seems to have this API, so you might have something older than 2015. I think that I will add a version check to SoapyHackRF to catch this stuff at configure time, but not sure what else I can do here. You can always build libhackrf from source if the package manager is too old.

guruofquality avatar Jan 21 '18 00:01 guruofquality

I reinstalled a newer version of Raspbian and everything seemed to work just fine.

Kishaihd avatar Jan 22 '18 03:01 Kishaihd

I reinstalled a newer version of Raspbian and everything seemed to work just fine.

@Kishaihd Could you close the issue since its no longer an issue?

solomonbstoner avatar Jun 20 '21 16:06 solomonbstoner