Issue
I'm trying to call C++
method in Java
coding.
I received the Android NDK : Aborting. Stop
when defined the Android.mk
file as below :
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ffmpeg
LOCAL_SRC_FILES := libs/ffmpeg.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := ffmpeg
LOCAL_SRC_FILES := ffmpeg.cpp
LOCAL_SHARED_LIBRARIES := ffmpeg
include $(BUILD_SHARED_LIBRARY)
But if I defined like this, it run successfully :
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ffmpeg
LOCAL_SRC_FILES := libs/ffmpeg.so
include $(BUILD_SHARED_LIBRARY)
Questions
:
1 - How to fix this error?
2 - In Android.mk
file, Can not call libs/ffmpeg.so
and ffmpeg.cpp
in the same time?
People who know this,
Please tell me,
Thanks,
p/s : Project structure :
Solution
When seeing the Android.mk structure
.
I think I need change Android.mk
file like this :
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ffmpeg
LOCAL_SRC_FILES := libs/ffmpeg.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := final_ffmpeg
LOCAL_SRC_FILES := ffmpeg.cpp
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
LOCAL_PREBUILTS := libs/ffmpeg.so
#libavformat libavcodec libswscale libavutil
include $(BUILD_SHARED_LIBRARY)
The result will help me :
It still be exactly when you need call the C++ function in C++ file from Java file.
Answered By - Huy Tower
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.