Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> Android NDK 下編譯FDK-AAC解碼器

Android NDK 下編譯FDK-AAC解碼器

編輯:關於Android編程

成功!

http://sourceforge.net/projects/opencore-amr/files/fdk-aac/

-------------------------- myconfig.sh ------------------------------------
#!/bin/sh

export ARM_ROOT=/opt/ndk/android-ndk-r8e
export ARM_INC=$ARM_ROOT/platforms/android-14/arch-arm/usr/include
export ARM_LIB=$ARM_ROOT/platforms/android-14/arch-arm/usr/lib
 
export CXXFLAGS= -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti   -I/opt/ndk/android-ndk-r8e/platforms/android-8/arch-arm/usr/include

export LDFLAGS=-Wl,-Bsymbolic --sysroot=/opt/ndk/android-ndk-r8e/platforms/android-14/arch-arm -lgcc -no-canonical-prefixes  -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now   -L/opt/ndk/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib  -lm 

./configure --host=arm-linux-androideabi  --prefix=/opt/ndk/openlib   

--------------fdk-aac-0.1.1 編譯過程中遇到的問題 ---------------------------

FAQ:
1. 顯示編譯過程 手工去掉Makefile中 
AM_DEFAULT_VERBOSITY = 0改為1

或-------------
am__v_CXX_0 = @echo   CXX    $@; 中紅色的@
   顯示鏈接過程
am__v_GEN_0 = echo   GEN    $@;



2. 實際的編譯命令行
echo   CXX    libSYS/src/cmdl_parser.lo;depbase=`echo libSYS/src/cmdl_parser.lo | sed 's|[^/]*$|.deps/&|;s|.lo$||'`;
/bin/sh ./libtool --silent --tag=CXX   --mode=compile  arm-linux-androideabi-g++ -DPACKAGE_NAME=dk-aac -DPACKAGE_TARNAME=dk-aac -DPACKAGE_VERSION=.1.1 -DPACKAGE_STRING=dk-aac 0.1.1 -DPACKAGE_BUGREPORT=http://sourceforge.net/projects/opencore-amr/ -DPACKAGE_URL=\ -DPACKAGE=dk-aac -DVERSION=.1.1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=.libs/ -DHAVE_LIBM=1 -I.  -I./libAACdec/include -I./libAACenc/include -I./libSBRdec/include -I./libSBRenc/include -I./libMpegTPDec/include -I./libMpegTPEnc/include -I./libSYS/include -I./libFDK/include -I./libPCMutils/include  -fno-exceptions -fno-rtti -I/opt/ndk/android-ndk-r8e/platforms/android-14/arch-arm/usr/include -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID  -Wa,--noexecstack  -MT libSYS/src/cmdl_parser.lo -MD -MP -MF $depbase.Tpo -c -o libSYS/src/cmdl_parser.lo libSYS/src/cmdl_parser.cpp &&
紅色部分是自己加的

實際鏈接的命令行:
arm-linux-androideabi-gcc -shared  -fPIC -DPIC  libAACdec/src/.libs/aacdec_drc.o ... libSYS/src/.libs/wav_file.o   -lgcc -L/opt/ndk/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib -lm  -O2 -Wl,-Bsymbolic -Wl,-soname -Wl,libfdk-aac.so --sysroot=/opt/ndk/android-ndk-r8e/platforms/android-14/arch-arm -Wl,--no-undefined -Wl,-z -Wl,noexecstack -Wl,-z -Wl,relro -Wl,-z -Wl,now   -Wl,-soname -Wl,libfdk-aac.so.0 -Wl,-version-script -Wl,.libs/libfdk-aac.ver -o .libs/libfdk-aac.so.0.0.2


3. 編譯libSYS/src/cmdl_parser.cpp出錯 
stdio.h:57:9: error: 'off_t' does not name a type
注掉:
//#define _SYS_TYPES_H_

4. libSYS/src/genericStds.cpp:108 : stdio.h:57:9: error: 'off_t' does not name a type
修改libSYSincludegenericStds.h
//#define _SYS_TYPES_H_

5. link: `libSYS/src/cmdl_parser.lo' is not a valid libtool object
重新配置和編譯一遍就行,應該是cmdl_parser.lo在編譯時的配置和其他的不一樣導致的,這個文件當時是手工編譯的


 
  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved