raspberry pi – make failure (libi2c is missing)

I try to compile the following project: https://github.com/ovrheat/raspberry_rtl_wh1080 on my Raspberry Pi, unfortunately during the make I’m gettiong errors I can’t overcome to far:

> /raspberry_rtl_wh1080/build $ make
-- Build type not specified: defaulting to release.
-- Using Git version tag: -128-NOTFOUND on master at 201807090025 (refs/heads/ma                                                         ster commit 0201e8745dbdbe4106f4802a8b0213d58d5fdd13)
CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardAr                                                         gs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (LibRTLSDR).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:59 (find_package_handle_stan                                                         dard_args)
  cmake/Modules/FindLibRTLSDR.cmake:1 (INCLUDE)
  CMakeLists.txt:82 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/raspberry_rtl_wh1080/build
[  6%] Building C object src/CMakeFiles/data.dir/data.c.o
/home/pi/raspberry_rtl_wh1080/src/data.c:88:35: warning: cast between incompatib                                                         le function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘                                                         void * (*)(void *)’ [-Wcast-function-type]
   88 |       .array_element_release    = (array_element_release_fn) data_free,
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:89:35: warning: cast between incompatib                                                         le function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘                                                         void * (*)(void *)’ [-Wcast-function-type]
   89 |       .value_release            = (value_release_fn) data_free },
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:96:35: warning: cast between incompatib                                                         le function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-functi                                                         on-type]
   96 |       .value_release            = (value_release_fn) free },
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:103:35: warning: cast between incompati                                                         ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct                                                         ion-type]
  103 |       .value_release            = (value_release_fn) free },
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:109:35: warning: cast between incompati                                                         ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct                                                         ion-type]
  109 |       .array_element_release    = (array_element_release_fn) free,
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:110:35: warning: cast between incompati                                                         ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct                                                         ion-type]
  110 |       .value_release            = (value_release_fn) free },
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:116:35: warning: cast between incompati                                                         ble function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_ar                                                         ray *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
  116 |       .array_element_release    = (array_element_release_fn) data_array_                                                         free ,
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:117:35: warning: cast between incompati                                                         ble function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_ar                                                         ray *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
  117 |       .value_release            = (value_release_fn) data_array_free },
      |                                   ^
[ 13%] Linking C static library libdata.a
[ 13%] Built target data
[ 20%] Building C object src/CMakeFiles/rtl_433.dir/baseband.c.o
[ 26%] Building C object src/CMakeFiles/rtl_433.dir/bitbuffer.c.o
[ 33%] Building C object src/CMakeFiles/rtl_433.dir/data.c.o
/home/pi/raspberry_rtl_wh1080/src/data.c:88:35: warning: cast between incompatib                                                         le function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘                                                         void * (*)(void *)’ [-Wcast-function-type]
   88 |       .array_element_release    = (array_element_release_fn) data_free,
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:89:35: warning: cast between incompatib                                                         le function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘                                                         void * (*)(void *)’ [-Wcast-function-type]
   89 |       .value_release            = (value_release_fn) data_free },
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:96:35: warning: cast between incompatib                                                         le function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-functi                                                         on-type]
   96 |       .value_release            = (value_release_fn) free },
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:103:35: warning: cast between incompati                                                         ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct                                                         ion-type]
  103 |       .value_release            = (value_release_fn) free },
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:109:35: warning: cast between incompati                                                         ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct                                                         ion-type]
  109 |       .array_element_release    = (array_element_release_fn) free,
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:110:35: warning: cast between incompati                                                         ble function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-funct                                                         ion-type]
  110 |       .value_release            = (value_release_fn) free },
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:116:35: warning: cast between incompati                                                         ble function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_ar                                                         ray *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
  116 |       .array_element_release    = (array_element_release_fn) data_array_                                                         free ,
      |                                   ^
/home/pi/raspberry_rtl_wh1080/src/data.c:117:35: warning: cast between incompati                                                         ble function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_ar                                                         ray *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
  117 |       .value_release            = (value_release_fn) data_array_free },
      |                                   ^
[ 40%] Building C object src/CMakeFiles/rtl_433.dir/pulse_demod.c.o
[ 46%] Building C object src/CMakeFiles/rtl_433.dir/pulse_detect.c.o
[ 53%] Building C object src/CMakeFiles/rtl_433.dir/rtl_433.c.o
[ 60%] Building C object src/CMakeFiles/rtl_433.dir/optparse.c.o
[ 66%] Building C object src/CMakeFiles/rtl_433.dir/util.c.o
[ 73%] Building C object src/CMakeFiles/rtl_433.dir/devices/flex.c.o
[ 80%] Building C object src/CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o
In file included from /usr/include/aarch64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from /home/pi/raspberry_rtl_wh1080/include/data.h:24,
                 from /home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c:102:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c: In function ‘bmp085_i2c_Read_Int’:
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c:174:14: warning: implicit declaration of function ‘i2c_smbus_read_word_data’ [-Wimplicit-function-declaration]
  174 |  __s32 res = i2c_smbus_read_word_data(fd, address);
      |              ^~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c: In function ‘bmp085_i2c_Write_Byte’:
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c:189:6: warning: implicit declaration of function ‘i2c_smbus_write_byte_data’ [-Wimplicit-function-declaration]
  189 |  if (i2c_smbus_write_byte_data(fd, address, value) < 0) {
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c: In function ‘bmp085_i2c_Read_Block’:
/home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c:198:5: warning: implicit declaration of function ‘i2c_smbus_read_i2c_block_data’ [-Wimplicit-function-declaration]
  198 |  if(i2c_smbus_read_i2c_block_data(fd, address,length,values)<0) {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 86%] Linking C executable rtl_433
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_i2c_Read_Int':
fineoffset_wh1080.c:(.text+0x84): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_i2c_Write_Byte':
fineoffset_wh1080.c:(.text+0xc8): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_i2c_Read_Block':
fineoffset_wh1080.c:(.text+0xfc): undefined reference to `i2c_smbus_read_i2c_block_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_Calibration':
fineoffset_wh1080.c:(.text+0x160): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x188): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x1a8): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x1c8): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x1e8): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o:fineoffset_wh1080.c:(.text+0x208): more undefined references to `i2c_smbus_read_word_data' follow
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_ReadUT':
fineoffset_wh1080.c:(.text+0x330): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x348): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_ReadUP':
fineoffset_wh1080.c:(.text+0x3d0): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x3f0): undefined reference to `i2c_smbus_read_i2c_block_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `read_int_temp':
fineoffset_wh1080.c:(.text+0x598): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x5b0): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `read_press':
fineoffset_wh1080.c:(.text+0x6a4): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x6bc): undefined reference to `i2c_smbus_read_word_data'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/rtl_433.dir/build.make:239: src/rtl_433] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:212: src/CMakeFiles/rtl_433.dir/all] Fehler 2
make: *** [Makefile:149: all] Fehler 2

I would like to know, how I can link the missing -li2c or -li2cdev into trhe project. Where and how to add?

Thanks in advance!

Leave a Comment