Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various build errors (undefined reference to AndroidSurface) #24

Open
slhck opened this issue May 11, 2011 · 5 comments
Open

Various build errors (undefined reference to AndroidSurface) #24

slhck opened this issue May 11, 2011 · 5 comments

Comments

@slhck
Copy link

slhck commented May 11, 2011

I received various build errors using NDKv5 on OS X . I was able to fix most of them by manually copying missing header files to some locations and fixing the import statements. Still, one I can't resolve:

make: *** [/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libffmpeg_jni.so] Error 1
charon:android-ndk-r5b werner$ ./ndk-build 
Compile++ thumb  : mediaplayer <= output.cpp
Compile++ thumb  : mediaplayer <= mediaplayer.cpp
StaticLibrary  : libmediaplayer.a
SharedLibrary  : libffmpeg_jni.so
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::VideoDriver_updateSurface()':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:74: undefined reference to `AndroidSurface_updateSurface'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::VideoDriver_getPixels(int, int, void**)':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:69: undefined reference to `AndroidSurface_getPixels'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::VideoDriver_unregister()':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:64: undefined reference to `AndroidSurface_unregister'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::VideoDriver_register(_JNIEnv*, _jobject*)':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:59: undefined reference to `AndroidSurface_register'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::AudioDriver_write(void*, int)':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:52: undefined reference to `AndroidAudioTrack_write'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::AudioDriver_reload()':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:47: undefined reference to `AndroidAudioTrack_reload'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::AudioDriver_stop()':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:42: undefined reference to `AndroidAudioTrack_stop'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::AudioDriver_flush()':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:37: undefined reference to `AndroidAudioTrack_flush'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::AudioDriver_set(int, unsigned int, int, int)':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:32: undefined reference to `AndroidAudioTrack_set'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::AudioDriver_start()':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:21: undefined reference to `AndroidAudioTrack_start'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::AudioDriver_unregister()':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:16: undefined reference to `AndroidAudioTrack_unregister'
/Users/werner/Documents/Eclipse_Java/ffPlayer/obj/local/armeabi/libmediaplayer.a(output.o): In function `Output::AudioDriver_register()':
/Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp:11: undefined reference to `AndroidAudioTrack_register'
collect2: ld returned 1 exit status

There doesn't seem to be an <android/surface.h>, which is included in output.cpp.

I just copied it from /jni/include/android/surface.h to libmediaplayer/android/surface.h and changed output.cpp to reflect that, but still the implementation of above methods is just missing. There's no surface.cpp and no source file in your repository mentions any of those method signatures.

I know that the NDKv4 is supposed to work, but it doesn't:

charon:android-ndk-r4 werner$ ./ndk-build -C /Users/werner/Documents/Eclipse_Java/ffPlayer
Compile++ thumb: mediaplayer <= /Users/werner/Documents/Eclipse_Java/ffPlayer/jni/libmediaplayer/output.cpp
make: *** No rule to make target `/Users/werner/Documents/Eclipse_Java/ffPlayer/bin/ndk/local/armeabi/libjniaudio.so', needed by `/Users/werner/Documents/Eclipse_Java/ffPlayer/bin/ndk/local/armeabi/libmediaplayer.a'.  Stop.

Is there any way to overcome these errors? I'm stuck here. As mentioned above, I could get away several of those by just adding missing headers, but these are slightly more complicated.

Thanks for any help.

@alex-hryzak
Copy link

Hi Werner!

Found any solution to this? I keep having the exactly same errors with NDKv5 ...
I got NDKv4 working (copy the 2 misisng .so files from libs to bin/ndk/local/armeabi), but only audio - no video :-(

Greetings from ums Eck,
Alex

@slhck
Copy link
Author

slhck commented May 13, 2011

No luck. I kept searching for hours to find any implementation of these Surface methods. What I did in my frustration was to use Bambuser's ffmpeg builds. See my gameClient repo for the code. It should build just fine. at least I was able to generate all necessary .so files and load them from within the app.

@alex-hryzak
Copy link

Well, I found the implementations ...
libjniaudio.so ... https://github.com/havlenapetr/android_frameworks_base/tree/froyo-sgs/native/audio/jni
libjnivideo.so ... https://github.com/havlenapetr/android_frameworks_base/tree/froyo-sgs/native/video/jni
But I didn't managed to compile the them ...

Thanks, I will try Bambuser's ffmpeg builds!

@ashcairo
Copy link

Thanks too for the gameClient repo. I've also been battling to get this compile with no luck. GameClient compiled first time, can't wait to try it out tomorrow.

@slhck
Copy link
Author

slhck commented May 17, 2011

@ashcairo It's not fully working at the moment with the file I tried, but you can extract the whole FFmpeg and native part from it and see how far you can get it working! The native libs however load and the calls seem fine, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants