Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined reference errors when compiling for Pi2 #17

Open
tophee opened this issue Nov 11, 2019 · 4 comments
Open

Undefined reference errors when compiling for Pi2 #17

tophee opened this issue Nov 11, 2019 · 4 comments

Comments

@tophee
Copy link

tophee commented Nov 11, 2019

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
Copy link

sstober commented Nov 19, 2019

Same here on a Pi3B+

@sstober
Copy link

sstober commented Nov 19, 2019

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

@tophee
Copy link
Author

tophee commented Nov 19, 2019

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants