ffAudio / ff_meters

Plug and play component to display LED meters for JUCE audio buffers
BSD 3-Clause "New" or "Revised" License
113 stars 31 forks source link

std::sqrt no member named sqrtf #10

Open ElandaOfficial opened 4 years ago

ElandaOfficial commented 4 years ago

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 commented 4 years ago

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

ffAudio commented 4 years ago

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...

ElandaOfficial commented 4 years ago

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.