春山眉黛~xvid.mk文件书写注意事项

  • Post author:
  • Post category:其他


一、

vendor/sprd/proprietories-source/sprd_codecs/xvid//src/portab.h:134:6: error: You are trying to compile Xvid without defining address bus size.

#    error You are trying to compile Xvid without defining address bus size.

^

vendor/sprd/proprietories-source/sprd_codecs/xvid//src/portab.h:372:10: error: You are trying to compile Xvid without defining the architecture type.

#        error You are trying to compile Xvid without defining the architecture type.

^



solution


:add —LOCAL_CFLAGS += -DARCH_IS_32BIT -DARCH_IS_GENERIC -Wno-int-to-pointer-cast -Wno-implicit-function-declaration –std=c99

to .mk document



reason


:portab.h 配置信息不完善ARCH_IS_32BIT、ARCH_IS_GENERIC,需要将这些信息写入.mk文件中

二、

vendor/sprd/proprietories-source/sprd_codecs/xvid/examples/xvid_encraw.c:57:10: fatal error: ‘xvid.h’ file not found

#include “xvid.h”

solution :将.mk文件重新命名,放在了统一的路径下面,在整体的Android.mk文件中加入include $(LOCAL_PATH)/xvid.mk、include $(LOCAL_PATH)/xvid_encraw.mk

重新写.mk文件中头文件和源文件的路径

XVID_PATH := xvid/



LOCAL_SRC_FILES := \



$(XVID_PATH)/examples/xvid_encraw.c \




LOCAL_C_INCLUDES := \



$(LOCAL_PATH)/$(XVID_PATH)/src \

编译通过

三、

书写一个.mk文件需要修改的地方


xvid_encraw.mk



LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)


XVID_PATH := xvid/  //方便写路径

LOCAL_MODULE := utest_sw_xvidenc //生成文件的名称


LOCAL_MODULE_TAGS := debug

LOCAL_CFLAGS := -fno-strict-aliasing -Wno-date-time -D_VSP_LINUX_ -D_VSP_



LOCAL_CFLAGS += -DARCH_IS_32BIT -DARCH_IS_GENERIC -Wno-int-to-pointer-cast -Wno-implicit-function-declaration –std=c99 //文件需要进行的配置信息,要包含的define信息

LOCAL_PRELINK_MODULE := false

LOCAL_ARM_MODE := arm


LOCAL_SRC_FILES := \



$(XVID_PATH)/examples/xvid_encraw.c \  //源文件路径和文件名称




LOCAL_C_INCLUDES := \



$(LOCAL_PATH)/$(XVID_PATH)/src \  //头文件路径

LOCAL_SHARED_LIBRARIES :=  libomx_xvid_sw  //编译这个源文件需要调用的库的名称

LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)

LOCAL_PROPRIETARY_MODULE := true

include $(BUILD_EXECUTABLE)



Android.mk





LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

ifeq ($(strip $(TARGET_VSP_PLATFORM)),whale)

include $(LOCAL_PATH)/h265dec_hw.mk

include $(LOCAL_PATH)/h265enc_hw.mk

include $(LOCAL_PATH)/vspenc_hw.mk

endif

ifeq ($(strip $(TARGET_VSP_PLATFORM)),iwhale2)

include $(LOCAL_PATH)/h265dec_hw.mk

include $(LOCAL_PATH)/h265enc_hw.mk

include $(LOCAL_PATH)/vp9dec_hw.mk

include $(LOCAL_PATH)/vp9enc_hw.mk

endif

include $(LOCAL_PATH)/h264dec_hw.mk

include $(LOCAL_PATH)/h264dec_sw.mk

include $(LOCAL_PATH)/h264enc_hw.mk

include $(LOCAL_PATH)/m4vh263dec_hw.mk

include $(LOCAL_PATH)/m4vh263dec_sw.mk

include $(LOCAL_PATH)/m4vh263enc_hw.mk

include $(LOCAL_PATH)/vpxdec_hw.mk

include $(LOCAL_PATH)/m4vh263enc_sw.mk


include $(LOCAL_PATH)/xvid.mk

include $(LOCAL_PATH)/xvid_encraw.mk

//添加这两个文件,编译的过程中就会调用这两个新写好的mk文件来处理。

include $(call all-makefiles-under,$(LOCAL_PATH))

四、编译过程中遇见的类型检查报错问题处理

更改编译的环境,le不能通过,原因暂时不明~



版权声明:本文为weixin_38901159原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。