LAME(http://lame.sourceforge.net/)是一个用c语言编写的库.它可以将PCM声音文件转换为MP3文件.我用它将声音文件转换为iPhone上的MP3文件.源PCM声音文件由麦克风录制.
为了将LAME包含到我的XCode项目中,我需要将LAME编译为3个静态库(.a),i386(IOS模拟器),armv6和armv7.
经过大量搜索,我成功地为i368版本(iOS模拟器)编写了一个静态库.这是命令:
./configure \
CFLAGS="-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk" \
CC="/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386" \
--prefix=/Volumes/Data/test/i386 \
--host="arm-apple-darwin9"
make && make install
Run Code Online (Sandbox Code Playgroud)
问题是我无法编译armv6和armv7.我试过这个命令,但报告错误.有人有解决方案吗?
./configure \
CFLAGS="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk" \
CC="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv6" \
--prefix=/Volumes/Data/test/arm6 \
--host="arm-apple-darwin9"
make && make install
Run Code Online (Sandbox Code Playgroud)
错误是:
console.c:25:21: error: curses.h: No such file or directory
console.c:27:20: error: term.h: No such file or directory
console.c: In function ‘get_termcap_string’:
console.c:92: warning: implicit declaration of function ‘tgetstr’
console.c:92: warning: assignment makes pointer from integer without a cast
console.c: In function ‘get_termcap_number’:
console.c:102: warning: …
Run Code Online (Sandbox Code Playgroud)