ff_meters icon indicating copy to clipboard operation
ff_meters copied to clipboard

std::sqrt no member named sqrtf

Open ElandaOfficial opened this issue 5 years ago • 3 comments

The function std::sqrtf is not available by default in GCC, it requires you to add the -lm flag to the compiler which may damage portability.

Can be found in file ff_meters_LevelMeterSource.h:105 (LevelMeterSource::ChannelData::getAvgRMS())

Edit: Removing std seems to fix the problem

ElandaOfficial avatar May 26 '20 16:05 ElandaOfficial

Reopening this issue as I still cannot build this on GCC as sqrtf is still not in the standard.

ElandaOfficial avatar Jun 22 '20 18:06 ElandaOfficial

The module header adds the -lm to a linux build, see https://github.com/ffAudio/ff_meters/blob/master/ff_meters.h#L39

Doesn't this solve the issue? I am not sure, if falling back to the C sqrt is the right solution...

ffAudio avatar Jun 22 '20 19:06 ffAudio

According to different sources this is a bug in GCC rather than a missing linker target. They have not yet implemented this in the std namespace and thus only the C version seems to work.

ElandaOfficial avatar Jun 22 '20 20:06 ElandaOfficial