PATCH: Remove pow() and math.h from rtl-sdr.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at

Christian Vogel vogelchr at
Wed May 16 10:00:58 UTC 2012


apparently #include <math.h> is only needed for the declaration
of pow(2,22) used in rtlsdr_set_sample_rate(). Now gcc is smart
enough to convert pow(2,22) to a constant, but for example clang
isn't, and it complains about the missing math library.

Attached patches replace pow(2,22) by (float)1<<22 and remove
the math headers.


[tort /home/chris/rtl-sdr (b345963947b451f6…)]
$ make
./.libs/ undefined reference to `exp2'
collect2: ld returned 1 exit status
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [rtl_sdr] Error 1
make[2]: Leaving directory `/home/chris/rtl-sdr/src'

More information about the osmocom-sdr mailing list