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
问题是我无法为 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
错误是:
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: implicit declaration of function ‘tgetnum’
console.c: In function ‘apply_termcap_settings’:
console.c:115: warning: implicit declaration of function ‘tgetent’
make[2]: *** [console.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
当我安装 ncurses 时,它报告了这个:
../curses.h:60:25: error: ncurses_dll.h: No such file or directory
In file included from console.c:25:
../curses.h:250: warning: return type defaults to ‘int’
../curses.h: In function ‘NCURSES_EXPORT_VAR’:
../curses.h:250: error: expected declaration specifiers before ‘acs_map’
../curses.h:340: error: storage class specified for parameter ‘SCREEN’
../curses.h:341: error: storage class specified for parameter ‘WINDOW’
../curses.h:343: error: storage class specified for parameter ‘attr_t’
../curses.h:388: warning: empty declaration
../curses.h:401: error: expected specifier-qualifier-list before ‘attr_t’
../curses.h:443: warning: empty declaration
../curses.h:542: error: storage class specified for parameter ‘NCURSES_OUTC’
../curses.h:551: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘addch’
../curses.h:552: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘addchnstr’
../curses.h:553: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘addchstr’
../curses.h:554: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘addnstr’
有没有人可以给我一种将 LAME 编译为 armv6 和 armv7 的静态库(.a)的方法?