下载:

http://sourceforge.net/projects/lame/?source=typ_redirect

29544.jpg

编译:

  ./configure --prefix=/cygdrive/f/BaiduYunDownload/lame-3.99.5/out_build/
 mingw32-make.exe
 mingw32-make.exe install

在 cygwin 32bit 编译时报错,64bit 不存在此问题

见官方说明: http://www.linuxfromscratch.org/blfs/view/stable/multimedia/lame.html 

../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c: In function 'init_xrpow_core_sse':../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:65:18: warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]const __m128 vec_fabs_mask = _mm_loadu_ps(&fabs_mask._float[0]);^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:929:1: error: inlining failed in call to always_inline '_mm_loadu_ps': target specific option mismatch_mm_loadu_ps (float const *__P)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:65:18: error: called from hereconst __m128 vec_fabs_mask = _mm_loadu_ps(&fabs_mask._float[0]);^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:895:1: error: inlining failed in call to always_inline '_mm_set_ps1': target specific option mismatch_mm_set_ps1 (float __F)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:73:27: error: called from herevec_xrpow_max._m128 = _mm_set_ps1(0);^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:895:1: error: inlining failed in call to always_inline '_mm_set_ps1': target specific option mismatch_mm_set_ps1 (float __F)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:74:21: error: called from herevec_sum._m128 = _mm_set_ps1(0);^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:929:1: error: inlining failed in call to always_inline '_mm_loadu_ps': target specific option mismatch_mm_loadu_ps (float const *__P)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:77:25: error: called from herevec_tmp._m128 = _mm_loadu_ps(&(cod_info->xr[i])); /* load */^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:237:1: error: inlining failed in call to always_inline '_mm_and_ps': target specific option mismatch_mm_and_ps (__m128 __A, __m128 __B)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:78:25: error: called from herevec_tmp._m128 = _mm_and_ps(vec_tmp._m128, vec_fabs_mask); /* fabs */^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:181:1: error: inlining failed in call to always_inline '_mm_add_ps': target specific option mismatch_mm_add_ps (__m128 __A, __m128 __B)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:79:25: error: called from herevec_sum._m128 = _mm_add_ps(vec_sum._m128, vec_tmp._m128);^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:205:1: error: inlining failed in call to always_inline '_mm_sqrt_ps': target specific option mismatch_mm_sqrt_ps (__m128 __A)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:80:25: error: called from herevec_tmp._m128 = _mm_sqrt_ps(_mm_mul_ps(vec_tmp._m128, _mm_sqrt_ps(vec_tmp._m128)));^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:193:1: error: inlining failed in call to always_inline '_mm_mul_ps': target specific option mismatch_mm_mul_ps (__m128 __A, __m128 __B)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:80:25: error: called from herevec_tmp._m128 = _mm_sqrt_ps(_mm_mul_ps(vec_tmp._m128, _mm_sqrt_ps(vec_tmp._m128)));^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:205:1: error: inlining failed in call to always_inline '_mm_sqrt_ps': target specific option mismatch_mm_sqrt_ps (__m128 __A)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:80:25: error: called from herevec_tmp._m128 = _mm_sqrt_ps(_mm_mul_ps(vec_tmp._m128, _mm_sqrt_ps(vec_tmp._m128)));^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:229:1: error: inlining failed in call to always_inline '_mm_max_ps': target specific option mismatch_mm_max_ps (__m128 __A, __m128 __B)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:81:31: error: called from herevec_xrpow_max._m128 = _mm_max_ps(vec_xrpow_max._m128, vec_tmp._m128); /* retrieve max */^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:978:1: error: inlining failed in call to always_inline '_mm_storeu_ps': target specific option mismatch_mm_storeu_ps (float *__P, __m128 __A)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:82:9: error: called from here_mm_storeu_ps(&(xrpow[i]), vec_tmp._m128); /* store into xrpow[] */^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:895:1: error: inlining failed in call to always_inline '_mm_set_ps1': target specific option mismatch_mm_set_ps1 (float __F)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:84:21: error: called from herevec_tmp._m128 = _mm_set_ps1(0);^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:237:1: error: inlining failed in call to always_inline '_mm_and_ps': target specific option mismatch_mm_and_ps (__m128 __A, __m128 __B)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:89:29: error: called from herevec_tmp._m128 = _mm_and_ps(vec_tmp._m128, vec_fabs_mask); /* fabs */^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:181:1: error: inlining failed in call to always_inline '_mm_add_ps': target specific option mismatch_mm_add_ps (__m128 __A, __m128 __B)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:90:29: error: called from herevec_sum._m128 = _mm_add_ps(vec_sum._m128, vec_tmp._m128);^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:205:1: error: inlining failed in call to always_inline '_mm_sqrt_ps': target specific option mismatch_mm_sqrt_ps (__m128 __A)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:91:29: error: called from herevec_tmp._m128 = _mm_sqrt_ps(_mm_mul_ps(vec_tmp._m128, _mm_sqrt_ps(vec_tmp._m128)));^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:193:1: error: inlining failed in call to always_inline '_mm_mul_ps': target specific option mismatch_mm_mul_ps (__m128 __A, __m128 __B)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:91:29: error: called from herevec_tmp._m128 = _mm_sqrt_ps(_mm_mul_ps(vec_tmp._m128, _mm_sqrt_ps(vec_tmp._m128)));^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:205:1: error: inlining failed in call to always_inline '_mm_sqrt_ps': target specific option mismatch_mm_sqrt_ps (__m128 __A)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:91:29: error: called from herevec_tmp._m128 = _mm_sqrt_ps(_mm_mul_ps(vec_tmp._m128, _mm_sqrt_ps(vec_tmp._m128)));^In file included from ../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:37:0:C:/msys2/mingw32/lib/gcc/i686-w64-mingw32/4.9.1/include/xmmintrin.h:229:1: error: inlining failed in call to always_inline '_mm_max_ps': target specific option mismatch_mm_max_ps (__m128 __A, __m128 __B)^../../../lame-3.99.5/libmp3lame/vector/xmm_quantize_sub.c:92:35: error: called from herevec_xrpow_max._m128 = _mm_max_ps(vec_xrpow_max._m128, vec_tmp._m128); /* retrieve max */^Makefile:319: recipe for target 'xmm_quantize_sub.lo' failed

           Command Explanations

sed -i -e ‘/xmmintrin\.h/d’          configure : with gcc-4.9.0 and above, the compiler          issues an error on 32-bit machines, while compiling xmm_quantize_sub.c. The error message is:          error: inlining failed in call to          always_inline '_mm_loadu_ps'. This sed makes it appear as if          xmmintrin.h is not present. Do not          use this on other versions of gcc.         

解决办法:

见: https://gist.github.com/rdp/3581e2c51916f3d8056e

> +case $host_cpu in> +i686*)> + check_xmmintrin=> + ;;> +*)> + check_xmmintrin="xmmintrin.h"> + ;;> +esac> +>   for ac_header in \>   		 errno.h \>   		 fcntl.h \> @@ -11922,7 +11931,7 @@>   		 sys/soundcard.h \>   		 sys/time.h \>   		 unistd.h \> -		 xmmintrin.h \> +		 $check_xmmintrin \>   		 linux/soundcard.h

也可直接删除 configure 文件中 xmmintrin.h,

再编译时  lametime.c 中 lame_set_stream_binary_mode  , _O_BINARY 未定义,直接替换成 0x10000

    //setmode(fileno(fp), _O_BINARY);//0x10000

    setmode(fileno(fp), 0x10000);


再编译!