这是我第一次使用 MPG123 库,我有点困惑。 我找到了一个关于使用这个库和 libao 的小例子,但是当我尝试编译时我得到了一个错误。
这是“播放本地文件”的示例代码:http://hzqtc.github.io/2012/05/play-mp3-with-libmpg123-and-libao.html
我编译:gcc -O2 -o play play.c -lmpg123 -lao
我得到的错误是:
/tmp/ccmEoxBp.o: In function `main':
play.c:(.text.startup+0x8d): undefined reference to `mpg123_encsize'
collect2: ld returned 1 exit status
我错过了什么?
最佳答案
你有一个旧版本的 mp123 库,根据发行说明它是在 26.0.26 中添加的 https://github.com/gypified/libmpg123/blob/master/NEWS.libmpg123
26.0.26 - Added mpg123_encsize(). - Added flag MPG123_SKIP_ID3V2.
关于c - MPG123 库 : function mpg123_encsize not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18385169/