我试图在C++
编码中调用Java
方法。
我在定义Android NDK : Aborting. Stop
文件时收到了Android.mk
,如下所示:
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)
但如果我这样定义,它会成功运行:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ffmpeg
LOCAL_SRC_FILES := libs/ffmpeg.so
include $(BUILD_SHARED_LIBRARY)
Questions
:
1 - 如何解决此错误?
2 - 在Android.mk
文件中,无法同时拨打libs/ffmpeg.so
和ffmpeg.cpp
?
知道这一点的人,
请告诉我,
谢谢,
p / s:项目结构:
答案 0 :(得分:0)
我想我需要更改Android.mk
这样的文件:
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)
结果将对我有所帮助: