baycom / tfrec

SDR tool for receiving wireless sensor data (TFA IT+ KlimaLogg Pro, LaCrosse, WeatherHub)
GNU General Public License v2.0
68 stars 19 forks source link

Undefined reference errors when compiling for Pi2 #17

Open tophee opened 4 years ago

tophee commented 4 years ago

Hi, I succesfully compiled tfrec on an ubuntu 18.04 machine but on my Pi2, I can't get it to work:

pi@raspberrypi:~/tfrec $ sudo make -f Makefile.raspi2
g++  -rdynamic -o tfrec main.o engine.o dsp_stuff.o fm_demod.o decoder.o crc8.o tfa1.o tfa2.o utils.o sdr.o whb.o crc32.o -lm -L -lrtlsdr -lpthread
/usr/bin/ld: sdr.o: in function `sdr::read_thread()':
sdr.cpp:(.text+0xd8): undefined reference to `rtlsdr_read_async'
/usr/bin/ld: sdr.o: in function `sdr::sdr(int, int, int, char*)':
sdr.cpp:(.text+0x2d0): undefined reference to `rtlsdr_get_device_usb_strings'
/usr/bin/ld: sdr.cpp:(.text+0x360): undefined reference to `rtlsdr_open'
/usr/bin/ld: sdr.cpp:(.text+0x37c): undefined reference to `rtlsdr_set_freq_correction'
/usr/bin/ld: sdr.o: in function `sdr::~sdr()':
sdr.cpp:(.text+0x45c): undefined reference to `rtlsdr_cancel_async'
/usr/bin/ld: sdr.o: in function `sdr::search_device(char*)':
sdr.cpp:(.text+0x4f0): undefined reference to `rtlsdr_get_device_count'
/usr/bin/ld: sdr.cpp:(.text+0x568): undefined reference to `rtlsdr_get_device_usb_strings'
/usr/bin/ld: sdr.o: in function `sdr::start()':
sdr.cpp:(.text+0x634): undefined reference to `rtlsdr_reset_buffer'
/usr/bin/ld: sdr.o: in function `sdr::stop()':
sdr.cpp:(.text+0x728): undefined reference to `rtlsdr_cancel_async'
/usr/bin/ld: sdr.o: in function `sdr::set_frequency(unsigned int)':
sdr.cpp:(.text+0x7d8): undefined reference to `rtlsdr_set_center_freq'
/usr/bin/ld: sdr.o: in function `sdr::nearest_gain(int)':
sdr.cpp:(.text+0x848): undefined reference to `rtlsdr_set_tuner_gain_mode'
/usr/bin/ld: sdr.cpp:(.text+0x85c): undefined reference to `rtlsdr_get_tuner_gains'
/usr/bin/ld: sdr.cpp:(.text+0x880): undefined reference to `rtlsdr_get_tuner_gains'
/usr/bin/ld: sdr.o: in function `sdr::set_gain(int, float)':
sdr.cpp:(.text+0x930): undefined reference to `rtlsdr_set_tuner_gain_mode'
/usr/bin/ld: sdr.cpp:(.text+0x980): undefined reference to `rtlsdr_set_tuner_gain_mode'
/usr/bin/ld: sdr.cpp:(.text+0x98c): undefined reference to `rtlsdr_set_tuner_gain'
/usr/bin/ld: sdr.o: in function `sdr::set_ppm(int)':
sdr.cpp:(.text+0x9f8): undefined reference to `rtlsdr_set_freq_correction'
/usr/bin/ld: sdr.o: in function `sdr::set_samplerate(int)':
sdr.cpp:(.text+0xa28): undefined reference to `rtlsdr_set_sample_rate'
collect2: error: ld returned 1 exit status
make: *** [Makefile.raspi2:29: tfrec] Error 1
pi@raspberrypi:~/tfrec $
sstober commented 4 years ago

Same here on a Pi3B+

sstober commented 4 years ago

I was able to compile it using the workaround mentioned here: https://github.com/antirez/dump1090/issues/142#issuecomment-517997954 In my case, I had to edit the file /usr/lib/arm-linux-gnueabihf/pkgconfig/librtlsdr.pc

tophee commented 4 years ago

Thanks, I shall try that.

Have you also seen this project at https://github.com/merbanan/rtl_433? The TFA klimalogg sensors are not yet supported though.

Daniel-from-Germany commented 4 years ago

I was able to compile it using the workaround mentioned here: antirez/dump1090#142 (comment) In my case, I had to edit the file /usr/lib/arm-linux-gnueabihf/pkgconfig/librtlsdr.pc

On my RPI3 i must edit this file: /usr/local/lib/pkgconfig/librtlsdr.pc to: prefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian Linux version 4.19.97-v7+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1294 SMP Thu Jan 30 13:15:58 GMT 2020