windows使用MinGW编译faac库
下载mingw并安装,然后下载faac库,版本为Version 1.28 bootstrapped TAR.BZ2 Package,下载后进行解压,运行MinGW,进入到faac-1.28目录中,此时如果直接configure编译,会提示
mpeg4ip_win32.h:70: error: `_TRUNCATE' was not declared in this scope mpeg4ip_win32.h:70: error: `vsnprintf_s' was not declared in this scope mpeg4ip_win32.h:70: warning: unused variable '_TRUNCATE' mpeg4ip_win32.h:70: warning: unused variable 'vsnprintf_s' In file included from mp4common.h:32, from 3gp.cpp:28: mp4util.h: In function `void Indent(FILE*, u_int8_t)': mp4util.h:82: error: `fprintf_s' was not declared in this scope mp4util.h:82: warning: unused variable 'fprintf_s' make[3]: *** [3gp.o] Error 1 make[3]: Leaving directory `/d/faac-1.28/common/mp4v2' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/d/faac-1.28/common' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/d/faac-1.28' make: *** [all] Error 2
这是缺少faac的补丁,下载faac-1.28.diff,然后将其复制到faac-1.28目录中,执行下面的命令
patch -p1 < faac-1.28.diff
然后再执行
./bootstrap ./configure --prefix=/home --with-mp4v2 make make install
加入mp4v2是为了支持MP4容器的AAC音频,上面的命令执行完成后,就可以得到faac的lib和dll文件。