gpt4 book ai didi

Android NDK : Aborting. 停止

转载 作者:行者123 更新时间:2023-12-04 23:29:42 25 4
gpt4 key购买 nike

我正在尝试调用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.soffmpeg.cpp在同一时间?

知道这件事的人,

请告诉我,

谢谢,

p/s:项目结构:

enter image description here

最佳答案

当看到 Android.mk structure .

我想我需要改变 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)

结果将帮助我:

它仍然是您需要的时候 call the C++ function in C++ file from Java file .

关于Android NDK : Aborting. 停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22554516/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com