4

I am trying to build .so file for different cpu architecture in OpenH264.

README.md of OpenH264 suggest

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).

So I fired following command

For x86

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

I get something like

/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

and when I try to build it with armeabi

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

I get

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

can somebody point me how to compile this lib for different cpu architecture.

4

1 回答 1

2

对于 Linux
:首先运行这个命令

export PATH=ANDROID_SDK_PATH/tools:$PATH

湾。现在为 x86 ARCH 运行它。

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

对于其他 Arch 只需通过替换 ARCH 类型来运行它

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

对于 Windows
:安装 MinGW(https://www.youtube.com/watch?v=DHekr3EtDOA)。
湾。在 MinGW/bin 文件夹中安装 MYSY。
C。在 MinGW/bin/1.0/bin 文件夹中安装 nasm。
d。转到 MinGW\bin\1.0\ 位置并运行 msys.bat。
e. 通过替换 ARCH 类型运行以下命令。

make install os=android NDKROOT=/home/neosoft/android-ndk-r10d TARGET=android-14 ARCH=x86 
于 2016-07-21T06:15:19.490 回答