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

Build error with cygwin+NDKr4b #1

Open
Seasky opened this issue Sep 2, 2010 · 6 comments
Open

Build error with cygwin+NDKr4b #1

Seasky opened this issue Sep 2, 2010 · 6 comments

Comments

@Seasky
Copy link

Seasky commented Sep 2, 2010

Hi,havlenapetr:
When I download your source code and build it in Cygwin + android NDK r4b. I meet a error like "make: *** No rule to make target /cygdrive/c/android-ndk-r4b/samples/ffmpeg/obj/local/armeabi/libjniaudio.so', needed by/cygdrive/c/android-ndk-r4b
/samples/ffmpeg/obj/local/armeabi/libffmpeg_jni.so'. Stop."
And I check the /jni/jni/Android.mk file, there the libffmpeg_jni will use LOCAL_SHARED_LIBRARIES := libjniaudio libjnivideo, but I do not find which *.mk will create the two shared libraries. Could you tell what's wrong with it, how to resolve this problem. Thanks!

@havlenapetr
Copy link
Owner

these two libs are wrappers to android native AudioTrack and surface flinger so they couldn't be build in ndk. So I have build them in android build system and copy them into my ffmpeg project. They are in libs dir, if you copy them into 'ndk_dir/out/apps/your_ffmpeg_project_name/ then ggc will link them corectlly'

@Seasky
Copy link
Author

Seasky commented Sep 2, 2010

Thanks havlenapetr, as what you said, after I copy the two *.so files into \ffmpeg\obj\local\armeabi\objs\ dictory, this build error disappeared.

But I still meet a new problem as following:
$ $NDK/ndk-build
SharedLibrary : libffmpeg_jni.so
/cygdrive/c/android-ndk-r4b/samples/ffmpeg/obj/local/armeabi/objs/ffmpeg_jni/com_media_ffmpeg_FFMpegAVFormatContext.o: In function AVFormatContext_re lease': /cygdrive/c/android-ndk-r4b/samples/ffmpeg/jni/jni/com_media_ffmpeg_FFMpegAVFormatContext.c:85: undefined reference to__android_log_print'

I think this is because __android_log_print need external definition in android source code, but my build environment has only cygwin+NDK.

@havlenapetr
Copy link
Owner

sorry I don't know which branch are you building? Try debug branch and __android_log_print is defined in liblog.so which is in NDK, you can see this linkage in my Makefiles (LOCAL_LDLIBS := -llog)

@andjoy
Copy link

andjoy commented Sep 22, 2010

Dear Havlenapetr, i build this project in the same environment as seasky's, cygwin v2.721 + NDKr4b + Android SDK2.2, but i met some errors as following:
1,/cygdrive/e/cygwin/android-ndk-r4b/samples/havlenapetr-FFMpeg-ndk/jni/jni/../include/drivers_map.h:32: error: invalid conversion from 'int ()()' to 'int ()(JN
IEnv_, jobject)'
fixed as:typedef int (*audioDriver_register_t) ();
2,__android_log_print(ANDROID_LOG_INFO, TAG, "releasing FFMpegAVFormatContext"),
3,MediaPlayerControl mMediaPlayerControl = new MediaPlayerControl()
Multiple markers at this line
- The type new MediaController.MediaPlayerControl(){} must implement the inherited abstract method
MediaController.MediaPlayerControl.canSeekForward()
- The type new MediaController.MediaPlayerControl(){} must implement the inherited abstract method
MediaController.MediaPlayerControl.canSeekBackward()
- The type new MediaController.MediaPlayerControl(){} must implement the inherited abstract method MediaController.MediaPlayerControl.canPause()
fixed as: add unimplemented methods
4,\jni\jni\Android.mk
ifeq ($(IN_NDK),true)
LOCAL_LDLIBS := -llog
else
LOCAL_PRELINK_MODULE := false
LOCAL_SHARED_LIBRARIES := liblog
endif
fixed as:
ifeq ($(IN_NDK),true)
LOCAL_LDLIBS := -llog
else
LOCAL_PRELINK_MODULE := false
LOCAL_SHARED_LIBRARIES := liblog
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
endif

I tried to fix these issues, but the final apk doesn't work well. the app can only play some special mp4 files, and the size of libffmpeg_jni.so is only 3,329K Bytes. would you please tell me the right procedure to build this project?

@ashcairo
Copy link

Hi, I've currently gotten as far as the

SharedLibrary : libffmpeg_jni.so
/cygdrive/c/android-ndk-r4b/samples/ffmpeg/obj/local/armeabi/objs/ffmpeg_jni/com_media_ffmpeg_FFMpegAVFormatContext.o: In function AVFormatContext_re
lease':
/cygdrive/c/android-ndk-r4b/samples/ffmpeg/jni/jni/com_media_ffmpeg_FFMpegAVFormatContext.c:85: undefined reference to__android_log_print'

error.

Have you had any luck in finding a solution with getting the project to run?

@Seasky
Copy link
Author

Seasky commented May 18, 2011

You can try put the liblog.so into the obj directory. Good Luck!

Date: Tue, 17 May 2011 07:41:37 -0700
From: reply@reply.github.com
To: people205@hotmail.com
Subject: Re: [FFMpeg] Build error with cygwin+NDKr4b (#1)

Hi, I've currently gotten as far as the

SharedLibrary : libffmpeg_jni.so
/cygdrive/c/android-ndk-r4b/samples/ffmpeg/obj/local/armeabi/objs/ffmpeg_jni/com_media_ffmpeg_FFMpegAVFormatContext.o: In function AVFormatContext_re
lease':
/cygdrive/c/android-ndk-r4b/samples/ffmpeg/jni/jni/com_media_ffmpeg_FFMpegAVFormatContext.c:85: undefined reference to__android_log_print'

error.

Have you had any luck in finding a solution with getting the project to run?

Reply to this email directly or view it on GitHub:
#1 (comment)

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

4 participants