android openh264,Complile error OpenH264 using Android NDK

I am trying to compile the openh264 project for android but facing some trouble.

I have setup the android_ndk-r10 properly and able to compile sample apps provided with the ndk.

Here's what i've done till now. Downloaded the zip of openh264 from here https://github.com/cisco/openh264.

Navigated to the openh264-openh264v1.1\codec\build\android\dec\jni path using the cmd prompt and then fired the ndk-build command.

It starts the build process but throws error while building libs for both encoder and decoder. Following is the error while building encoder lib....

[armeabi] Compile++ thumb: welsencdemo <= welsenc.cpp

[armeabi] Compile++ thumb: welsencdemo <= read_config.cpp

[armeabi] Compile++ thumb: welsencdemo <= myjni.cpp

[armeabi] Prebuilt : libstlport_shared.so <= /sources/cxx-stl/stlport

/libs/armeabi/thumb/

[armeabi] SharedLibrary : libwelsencdemo.so

D:/Softwares/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/windo

ws-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-android

eabi/bin/ld.exe: D:/Work/Android/OpenH264/openh264-openh264v1.1/codec/build/andr

oid/enc//obj/local/armeabi/objs/welsencdemo/__/__/__/__/console/enc/src/welsenc.

o: in function CreateSVCEncHandle(ISVCEncoder**):D:/Work/Android/OpenH264/openh2

64-openh264v1.1/codec/build/android/enc//jni/../../../../console/enc/src/welsenc

.cpp:931: error: undefined reference to 'WelsCreateSVCEncoder'

D:/Softwares/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/windo

ws-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-android

eabi/bin/ld.exe: D:/Work/Android/OpenH264/openh264-openh264v1.1/codec/build/andr

oid/enc//obj/local/armeabi/objs/welsencdemo/__/__/__/__/console/enc/src/welsenc.

o: in function DestroySVCEncHandle(ISVCEncoder*):D:/Work/Android/OpenH264/openh2

64-openh264v1.1/codec/build/android/enc//jni/../../../../console/enc/src/welsenc

.cpp:937: error: undefined reference to 'WelsDestroySVCEncoder'

collect2: ld returned 1 exit status

make.exe: *** [D:/Work/Android/OpenH264/openh264-openh264v1.1/codec/build/androi

d/enc//obj/local/armeabi/libwelsencdemo.so] Error 1

Similarly while building the decoder lib facing an error as below....

[armeabi] Compile++ thumb: welsdecdemo <= h264dec.cpp

[armeabi] Compile++ thumb: welsdecdemo <= read_config.cpp

[armeabi] Compile++ thumb: welsdecdemo <= d3d9_utils.cpp

[armeabi] Compile++ thumb: welsdecdemo <= myjni.cpp

[armeabi] Prebuilt : libstlport_shared.so <= /sources/cxx-stl/stlport

/libs/armeabi/thumb/

[armeabi] SharedLibrary : libwelsdecdemo.so

D:/Softwares/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/windo

ws-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-android

eabi/bin/ld.exe: D:/Work/Android/OpenH264/openh264-openh264v1.1/codec/build/andr

oid/dec//obj/local/armeabi/objs/welsdecdemo/__/__/__/__/console/dec/src/h264dec.

o: in function DecMain(int, char**):D:/Work/Android/OpenH264/openh264-openh264v1

.1/codec/build/android/dec//jni/../../../../console/dec/src/h264dec.cpp:417: err

or: undefined reference to 'WelsCreateDecoder'

D:/Softwares/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/windo

ws-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-android

eabi/bin/ld.exe: D:/Work/Android/OpenH264/openh264-openh264v1.1/codec/build/andr

oid/dec//obj/local/armeabi/objs/welsdecdemo/__/__/__/__/console/dec/src/h264dec.

o: in function DecMain(int, char**):D:/Work/Android/OpenH264/openh264-openh264v1

.1/codec/build/android/dec//jni/../../../../console/dec/src/h264dec.cpp:447: err

or: undefined reference to 'WelsDestroyDecoder'

collect2: ld returned 1 exit status

make.exe: *** [D:/Work/Android/OpenH264/openh264-openh264v1.1/codec/build/androi

d/dec//obj/local/armeabi/libwelsdecdemo.so] Error 1

Before trying to build I did not make any changes to the openh264 code that I downloaded. Its a linking error, I tried to fix by making changes to the welsdecdemo.mk file that refers to the .h and .cpp files that are available in the code, but still getting the same error. As am a java developer and new with NDK and cpp am facing a tough time.

Request your help, with some useful pointers in the right direction.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值