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 to `rtlsdr_get_freq' #6

Closed
alphafox02 opened this issue Apr 18, 2022 · 11 comments
Closed

undefined reference to `rtlsdr_get_freq' #6

alphafox02 opened this issue Apr 18, 2022 · 11 comments

Comments

@alphafox02
Copy link

Using 20.04's librtlsdr-dev on x64 I see the following when running make. I wasn't sure if it's just me, just the version of librtlsdr in 20.04, or something else as it appears others are compiling this without error.

Commenting out 756 and un-commenting line 757 that has the note of "original imprecise version" allows make to complete and the project builds.

rtlsdr.c: In function ‘set_correct_freq’:
rtlsdr.c:756:15: warning: implicit declaration of function ‘rtlsdr_get_freq’; did you mean ‘rtlsdr_get_xtal_freq’? [-Wimplicit-function-declaration]
  756 |   double tf = rtlsdr_get_freq(sdr->device);
      |               ^~~~~~~~~~~~~~~
      |               rtlsdr_get_xtal_freq
rtlsdr.c: In function ‘main’:
rtlsdr.c:289:3: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
  289 |   asprintf(&sdr->frequency_file,"%s/tune-rtlsdr.%llx",VARDIR,(unsigned long long)sdr->SN);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -L/usr/local/lib -o rtlsdr rtlsdr.o libradio.a -lrtlsdr -lavahi-client -lavahi-common -lbsd -lm -lpthread
/usr/bin/ld: rtlsdr.o: in function `set_correct_freq':
rtlsdr.c:(.text+0xa9f): undefined reference to `rtlsdr_get_freq'
collect2: error: ld returned 1 exit status
make: *** [Makefile:95: rtlsdr] Error 1

@ka9q
Copy link
Owner

ka9q commented Apr 18, 2022 via email

@alphafox02
Copy link
Author

I see, now it makes sense. I can close this if you’d like. I want to incorporate this into my DragonOS project someday. Maybe having it preinstalled or capable of working with another project like SigDigger etc.

@ka9q
Copy link
Owner

ka9q commented Apr 18, 2022 via email

@ka9q
Copy link
Owner

ka9q commented Apr 19, 2022 via email

@alphafox02
Copy link
Author

alphafox02 commented Apr 19, 2022

Thank you for the explanation, would've never known that. I just pulled down the code, this time on aarch64 20.04 and compiled with issue your new changes. I've not yet fully understood how to run/use it, but that's my next step. I think the original ticket is resolved, however, I can try (hopefully) and test the code before closing.

Edit:

Well good news, bad news. I figured out how to use my remote Pi/airspy setup by running airspy 2m (after I changed the serial number in the conf), but I think because it took control or did something with eth0/network - I lost my remote connection.. ha! But progress and the airspy did set itself up.

@ka9q
Copy link
Owner

ka9q commented Apr 20, 2022 via email

@alphafox02
Copy link
Author

I think because maybe the conf file was doing something with eth0 and my remote Pi was on WiFi - I immediately lost realvnc connection when the application started. It’s no biggie, just have to wait for someone to reset the Pi for me.

@ka9q
Copy link
Owner

ka9q commented Apr 20, 2022 via email

@alphafox02
Copy link
Author

alphafox02 commented Apr 20, 2022

Later today or tomorrow I’ll setup something locally where I have the ability to see what happens on screen if/when the disconnect happens. To clarify, the Pi4 is setup on WiFi and the connection was via a RealVNC server/client configuration. Once I get another system locally setup, I can also try out the rtlsdr for this particular ticket.

@ka9q
Copy link
Owner

ka9q commented Apr 20, 2022 via email

@ka9q ka9q closed this as completed Apr 22, 2022
@ka9q
Copy link
Owner

ka9q commented Apr 22, 2022

rtlsdr should now compile cleanly with old version of librtlsdr-dev

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

2 participants