FormatManager.createReaderFor issue with MemoryInputStream

I found a lot of older posts using the following two lines to load in binary audio data:

MemoryInputStream* input = new MemoryInputStream (BinaryData::fille_wav, BinaryData::file_wav_size, false);
auto reader = audioFormatManager.createReaderFor (input);

But that doesn’t seem to work anymore. Someone posted this solution that seemed to work for them:

std::unique_ptr<InputStream> stream = std::make_unique<MemoryInputStream>(fileData, true);
AudioFormatReader* reader = m_FormatManager.createReaderFor(std::move(stream));

In my code, that looks like this:

std::unique_ptr<InputStream> stream = std::make_unique<MemoryInputStream>(
            BinaryData::clickSample_wav, BinaryData::clickSample_wavSize, false);
AudioFormatReader* reader = mFormatManager.createReaderFor(std::move(stream));

But I get an error:

No matching member function for call to ‘createReaderFor’

Without std::move, I still get the same error.
Any ideas what might be causing that? Does binary data need to be handled differently? Android studio says that stream is std::unique_ptr<InputStream>, which is what I intended it to be.

Is mFormatManager const in this context?

perhaps something more along those lines :

auto stream = std::make_unique<MemoryInputStream> (BinaryData::clickSample_wav, BinaryData::clickSample_wavSize, false);
std::unique_ptr<AudioFormatReader> reader (mFormatManager.createReaderFor (stream.release(), true));

If you use a very old version of juce, chances are the AudioFormatReader uses the old API with raw pointers (JUCE 6 or 5).

Make it a habit not to stop reading at the line “Error”. The compiler usually adds clues, like “Considered overloads” mentioning the function and the arguments it could accept.

Since you don’t use the juce:: namespace prefix, it could also be that the problem is much earlier. In that case AudioFormatManager might be seen as unknown type but the compiler still runs witlessly into the battlefield.

So: which juce version are you using?
What is the additional info after the line “No matching function”?