1

I'm currently working on a AAC Decoder on Windows using Microsoft Media Foundation. I'm using the Source Reader and it's method MFCreateSourceReaderFromByteStream. When I compile I get following error: undefined reference to `MFCreateSourceReaderFromByteStream@12'

  • This is how my Makefile looks like under LIBS: LIBS = -lpthread -lFLAC-8 -lFLAC++-6 -lOpenAl32 -lm -lcurl-4 -lole32 -lmfplat

What other libs do I need to include?

Compiler used: mingw32 gcc

Thanks

Almir
  • 167
  • 1
  • 2
  • 6

1 Answers1

0

The docs show clearly that you need to link to Mfreadwrite.lib

EdChum
  • 376,765
  • 198
  • 813
  • 562
  • I've tried both: 1) -lmfreadwrite and 2) -Mfreadwrite.lib But no luck – Almir Apr 27 '15 at 10:03
  • Get this when I add "-mfreadwrite": C:/msys64/mingw32/lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lmfreadwrite collect2.exe: error: ld returned 1 exit status And I get this when I add "-Mfreadwrite.lib": g++.exe: error: unrecognized command line option '-mfreadwrite.lib' – Almir Apr 27 '15 at 10:13
  • So where is mfreadwrite.lib on your machine? I'm assuming you do have it on your machine – EdChum Apr 27 '15 at 10:13
  • The location for the .dll is under Windows/system32. I'm not sure where the .lib is though. – Almir Apr 27 '15 at 10:18
  • did you install it? It's normally distributed as part of the platform SDK or as part of visual studio – EdChum Apr 27 '15 at 10:20
  • I have both the SDK and Visual Studio installed. – Almir Apr 27 '15 at 10:24
  • The [docs](https://msdn.microsoft.com/en-us/library/windows/desktop/ms696274(v=vs.85).aspx) show that it's part of the [SDK](https://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx) – EdChum Apr 27 '15 at 10:24
  • Please search your machine for the lib if you have the SDK installed – EdChum Apr 27 '15 at 10:25
  • Have a look here: https://www.dropbox.com/s/5ltnps0zcjocb88/Screen%20Shot%202015-04-27%20at%2012.31.58.png?dl=0 – Almir Apr 27 '15 at 10:32
  • Great so have you tried linking to the relevant one? – EdChum Apr 27 '15 at 10:33
  • See related: http://stackoverflow.com/questions/341387/adding-a-directory-for-the-headers-in-a-makefile – EdChum Apr 27 '15 at 10:46
  • Are you using vanilla MinGW or MinGW-w64? If the former, then try the latter. MinGW-w64 has far better support for APIs introduced after Windows 2000. – andlabs Apr 27 '15 at 13:51