LAME (http://lame.sourceforge.net/) là một thư viện được viết bằng ngôn ngữ c. Nó có thể chuyển đổi các tập tin âm thanh PCM sang các tập tin MP3. Tôi sử dụng nó để chuyển đổi các tập tin âm thanh sang các tập tin MP3 trên iPhone. Các tệp âm thanh PCM nguồn được ghi lại bằng micrô.Làm thế nào tôi có thể biên dịch lame thành thư viện tĩnh (.a) cho armv6 và armv7 của iPhone?
Để đưa LAME vào dự án XCode của mình, tôi cần biên dịch LAME thành 3 thư viện tĩnh (.a), cho i386 (IOS Simulator), armv6 và armv7.
Sau nhiều lần tìm kiếm, tôi đã tuân thủ một thư viện tĩnh cho phiên bản i368 (Trình mô phỏng iOS) thành công. Đây là các lệnh:
./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
Vấn đề là tôi không thể biên dịch cho armv6 và armv7. Tôi đã thử các lệnh này nhưng nó báo cáo lỗi. Có ai có giải pháp?
./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
Lỗi này là:
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
Khi tôi cài đặt ncurses, Nó báo cáo này:
../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’
Có ai đó có thể cho tôi một cách để biên dịch LAME vào thư viện tĩnh (. a) cho armv6 và armv7?
Man, câu trả lời của bạn là trình tiết kiệm cuộc sống :))) Cảm ơn rất nhiều! – Anton
@mcrute Tôi đang sử dụng tập lệnh chính xác này ngoại trừ tôi đã thay đổi phiên bản sdk thành 6.0 và tôi nhận được lỗi sau vào cuối: lipo: build/libmp3lame-armv6.a và xây dựng/libmp3lame-armv7.a có cùng kiến trúc (armv7) và không thể nằm trong cùng một tệp kết xuất chất béo – JonathanC
@mcrute cũng lưu ý rằng để hỗ trợ iPhone5, bạn cần phải thêm PLATFORM = "armv7s" build_lame – JonathanC