2015-09-04 47 views
4

我想在OpenH264中爲不同的CPU架構構建.so文件。 OpenH264的建立.so文件爲OpenH264 android

README.md建議

add "ARCH=mips" or "ARCH=x86". To build for the older armeabi ABI (which has 
armv5te as baseline), add "APP_ABI=armeabi" (ARCH=arm is implicit). 

所以我解僱以下命令

對於x86

make os=android NDKROOT=/home/neosoft/android-ndk-r10d/ ARCH=x86 TARGET=android-12 

我得到類似

/usr/bin/ld: cannot find crti.o: No such file or directory 
/usr/bin/ld: cannot find -lpthread 
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.so when searching for -lstdc++ 
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a when searching for -lstdc++ 
/usr/bin/ld: cannot find -lstdc++ 
/usr/bin/ld: cannot find -lm 
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for -lgcc_s 
/usr/bin/ld: cannot find -lgcc_s 
/usr/bin/ld: cannot find -lc 
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for -lgcc_s 
/usr/bin/ld: cannot find -lgcc_s 
/usr/bin/ld: cannot find crtn.o: No such file or directory 
collect2: error: ld returned 1 exit status 
make: *** [libopenh264.so] Error 1 

,當我嘗試至 與armeabi

make os=android NDKROOT=/home/neosoft/android-ndk-r10d/ ARCH=armeabi TARGET=android-12 

構建它,我得到

cc -O3 -DHAVE_NEON -Wall -fno-strict-aliasing -fPIC -DLINUX -MMD -MP -Icodec/common/arm/ -march=armv7-a -mfpu=neon -Icodec/api/svc -Icodec/common/inc -c -o codec/common/arm/copy_mb_neon.o codec/common/arm/copy_mb_neon.S 
cc: error: unrecognized command line option ‘-mfpu=neon’ 
make: *** [codec/common/arm/copy_mb_neon.o] Error 1 

有人能指出我如何編譯這個LIB針對不同的CPU架構。

回答

0

對於linux:
a。首先運行這個命令

export PATH=ANDROID_SDK_PATH/tools:$PATH 

b。現在運行這個x86 ARCH。
一個:

make install os=android NDKROOT=/home/neosoft/android-ndk-r10d TARGET=android-14 ARCH=x86 

對於其他拱門只替換ARCH類

make os=android NDKROOT=/home/neosoft/android-ndk-r10d TARGET=android-14 ARCH=armeabi 

對於Windows運行此。安裝MinGW(https://www.youtube.com/watch?v=DHekr3EtDOA)。 b。在MinGW/bin文件夾中安裝MYSY。
c。在MinGW/bin/1.0/bin文件夾中安裝nasm。 d。轉到MinGW \ bin \ 1.0 \ location並運行msys.bat。 e。
e。通過替換ARCH類型運行以下命令。

make install os=android NDKROOT=/home/neosoft/android-ndk-r10d TARGET=android-14 ARCH=x86 
+2

Thansk man ..你救了我的時間:D – RajibTheKing