gpt4 book ai didi

android.mk LOCAL_MODULE_FILENAME 不应包含扩展名

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:26:39 25 4
gpt4 key购买 nike

我正在尝试从 libavcodeclibavutil 构建一些文件

正在关注 this ,我创建了 Android.mk 文件如下:

jni/Android.mk 包含

LOCAL_PATH := $(call my-dir)

FFMPEG_TOP := $(LOCAL_PATH)

include $(CLEAR_VARS)

include $(FFMPEG_TOP)/libavutil/Android.mk
include $(FFMPEG_TOP)/libavcodec/Android.mk



LOCAL_PATH := $(FFMPEG_TOP)
LOCAL_MODULE := mylib
LOCAL_ARM_MODE := arm # remove this if you want thumb mode
LOCAL_SRC_FILES := myfunc1.c myfunc2.c maincfunction.c 3rdparty1.c 3rdparty2.c

LOCAL_SRC_FILES += libavcodec.a libavutil.a

LOCAL_LDLIBS := -llog

include $(BUILD_SHARED_LIBRARY)

jni/libavcodec/Android.mk包含

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

SOURCE_H264_DECODER += h264.c h264idct.c h264pred.c h264_parser.c cabac.c
SOURCE_H264_ENCODER += h264enc.c h264dspenc.c

SOURCE_HAVE_ARM = \
arm/dsputil_arm.c \
arm/dsputil_arm_s.S \
arm/jrevdct_arm.S \
arm/mpegvideo_arm.c \
arm/simple_idct_arm.S

SOURCE_HAVE_ARMV5TE = \
arm/mpegvideo_armv5te.c \
arm/mpegvideo_armv5te_s.S \
arm/simple_idct_armv5te.S

SOURCE_HAVE_ARMVFP = \
arm/dsputil_vfp.S \
arm/float_arm_vfp.S

SOURCE_HAVE_ARMV6 = arm/simple_idct_armv6.S

LOCAL_SRC_FILES := \
allcodecs.c \
audioconvert.c \
bitstream.c \
bitstream_filter.c \
dsputil.c \
eval.c \
faanidct.c \
imgconvert.c \
jrevdct.c \
opt.c \
options.c \
parser.c \
raw.c \
resample.c \
resample2.c \
simple_idct.c \
utils.c

LOCAL_SRC_FILES += $(SOURCE_H263_ENCODER)
LOCAL_SRC_FILES += $(SOURCE_H264_DECODER)

LOCAL_SRC_FILES += $(SOURCE_HAVE_ARM)
LOCAL_SRC_FILES += $(SOURCE_HAVE_ARMV5TE)
LOCAL_SRC_FILES += $(SOURCE_HAVE_ARMVFP)

LOCAL_MODULE := libavcodec

LOCAL_PRELINK_MODULE := false


LOCAL_C_INCLUDES := \
$(FFMPEG_TOP)/ \
$(FFMPEG_TOP)/libavutil/ \
$(LOCAL_PATH) \
$(LOCAL_PATH)/arm/

LOCAL_CFLAGS += -O4 -mno-thumb-interwork -mno-thumb -marm -DHAVE_AV_CONFIG_H

include $(BUILD_STATIC_LIBRARY)

jni/libavutil/Android.mk 包含 LOCAL_PATH:= $(调用我的目录)

include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
adler32.c \
aes.c \
avstring.c \
base64.c \
crc.c \
des.c \
fifo.c \
intfloat_readwrite.c \
lfg.c \
lls.c \
log.c \
lzo.c \
mathematics.c \
md5.c \
mem.c \
random.c \
random_seed.c \
rational.c \
rc4.c \
sha1.c \
tree.c \
utils.c

LOCAL_MODULE := libavutil

LOCAL_PRELINK_MODULE := false

LOCAL_C_INCLUDES := \
$(FFMPEG_TOP)/ \
$(LOCAL_PATH) \
$(LOCAL_PATH)/arm/

LOCAL_CFLAGS += -O4 -mno-thumb-interwork -mno-thumb -marm -DHAVE_AV_CONFIG_H

include $(BUILD_STATIC_LIBRARY)

解决的问题 here与我面临的问题无关,尽管错误类似。

我得到的错误是:

Android NDK: jni/inner/Android.mk:mylib: LOCAL_MODULE_FILENAME should not include file extensions
Android NDK: jni/inner/Android.mk:mylib: LOCAL_MODULE_FILENAME must not contain a file extension

请帮忙!![我经常遇到 headless 问题!!]

最佳答案

您需要确保在包含构建静态库的 make 文件后调用 include $(CLEAR_VARS)。模块文件名的自动生成仅在该变量为空时有效,并且您之前的 make 文件包含在您调用 $include ($BUILD_STATIC_LIBRARY)

时最终定义它

关于android.mk LOCAL_MODULE_FILENAME 不应包含扩展名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20901031/

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