pwarren/rtl-entropy

‘BLADERF_FORMAT_SC16_Q11’ undeclared

Closed this issue · 4 comments

wprpt commented

When compiling on debian with repository installed libbladerf-dev:amd64 0.9.0.15.8ba2499-1, the following error occurs:

Scanning dependencies of target rtlentropylib
[ 20%] Building C object src/CMakeFiles/rtlentropylib.dir/fips.c.o
[ 40%] Building C object src/CMakeFiles/rtlentropylib.dir/log.c.o
[ 60%] Building C object src/CMakeFiles/rtlentropylib.dir/util.c.o
Linking C static library librtlentropylib.a
[ 60%] Built target rtlentropylib
Scanning dependencies of target brf_entropy
[ 80%] Building C object src/CMakeFiles/brf_entropy.dir/brf_entropy.c.o
/tmp/rtl-entropy/src/brf_entropy.c: In function ‘main’:
/tmp/rtl-entropy/src/brf_entropy.c:441:6: error: ‘BLADERF_FORMAT_SC16_Q11’ undeclared (first use in this function)
      BLADERF_FORMAT_SC16_Q11,
      ^
/tmp/rtl-entropy/src/brf_entropy.c:441:6: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [src/CMakeFiles/brf_entropy.dir/brf_entropy.c.o] Error 1
make[1]: *** [src/CMakeFiles/brf_entropy.dir/all] Error 2
make: *** [all] Error 2

After looking through /usr/include/libbladeRF.h, BLADERF_FORMAT_SC16_Q11 is not referenced but BLADERF_FORMAT_SC16_Q12 is.

Im not sure whether this should be updated or libbladeRF. Either way, I updated my clone and compiled successfully.

W-M-D commented

What debian version are you on i'll try and see if i can reproduce.

wprpt commented

Calling it debian was not entirely accurate...
Running linux mint 17.3 but pulling from Ubuntu Trusty repositories.

jynik commented

libbladeRF 0.9.x is quite old -- this was from the early days of the device when the API was still marked "unstable."

I'd recommend fetching a newer package or building from source. If you want just a quick hack though, you can safely #define BLADERF_FORMAT_SC16_Q11 BLADERF_FORMAT_SC16_Q12 in the header.

Basically, the Q11 in the macro definition was a misnomer. In libbladeRF v0.12.0 it was corrected to Q12, and the Q11 macro was marked deprecated and scheduled for removal.

In the libbladeRF 1.x.y series, this deprecated macro definition was removed.

For a summary of other changes since v0.9.0, see the libbladeRF CHANGELOG.

wprpt commented

@jynik thanks for the info!