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

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


Hi,

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.

	Chris

[tort /home/chris/rtl-sdr (b345963947b451f6…)]
$ make
(...)
./.libs/librtlsdr.so: 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