交叉编译mpg123

交叉编译mpg123

下载源码https://sourceforge.net/projects/mpg123/files/
解压后进入源码目录
生成Makefile
./configure CC=arm-openwrt-linux-gcc --host=arm-openwrt-linux --with-default-audio=alsa --enable-static --prefix=pwd/install/
编译
make
安装
make install
拷贝install下的lib/libmpg123.so* lib/libmpg123.so* lib/mpg123/到板子/usr/lib下, bin/mpg123到板子/usr/bin/下。
测试
export MPG123_MODDIR=/usr/lib/mpg123
mpg123 -o alsa -a hw:0,0 test.mp3

注意:如果不执行export那步,会报错
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.25.10; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
[src/libout123/module.c:185] error: Failure getting module directory! (Perhaps set MPG123_MODDIR?)
[src/libout123/libout123.c:455] error: Found no driver out of [oss] working with device hw:0.
main: [src/mpg123.c:309] error: out123 error 3: failure loading driver module

作者:帅得不敢出门 c++哈哈堂:31843264

猜你喜欢

转载自blog.csdn.net/zmlovelx/article/details/93205799