22. 编译报错分析

来源:互联网 发布:mac上的sfc模拟器 编辑:程序博客网 时间:2024/06/04 23:27
常见编译报错汇总关键字:error:make[FAILED:multiple definition1. 摄像头兼容个数超过16个 - 增大为18个alps\kernel-3.18\drivers\misc\mediatek\imgsensor\src\mt6735m\kd_sensorlist.h#define MAX_NUM_OF_SUPPORT_SENSOR 16ACDK_KD_SENSOR_INIT_FUNCTION_STRUCT kdSensorList[MAX_NUM_OF_SUPPORT_SENSOR]={...}报错log: excess elements in array initializer(给数组塞了超过初始化个数的元素)In file included from alps/kernel-3.18/drivers/misc/mediatek/imgsensor/src/mt6735m/kd_sensorlist.c:39:0:alps/kernel-3.18/drivers/misc/mediatek/imgsensor/src/mt6735m/kd_sensorlist.h:677:5: error: excess elements in array initializer [-Werror] {T4KA3_SENSOR_ID, SENSOR_DRVNAME_T4KA3_MIPI_RAW, T4KA3_MIPI_RAW_SensorInit}, ^2. 安卓5.1 新增驱动需要在alps\kernel-3.10\drivers\misc\mediatek\Kconfig.drivers中建宏3. makefile从安卓6.0移植到安卓5.1,需要修改参照同一目录其他Makefile修改4. 缺少头文件包含 - (安卓5.1)fae提供的代码qma6981.c, 没有包含包含头文件accel.h, 导致编译移植报结构体struct sensor_init_info定义不一致+#include <accel.h>报错log: alps/kernel-3.10/drivers/misc/mediatek/accelerometer/qma6981/qma6981.c: In function 'qma6981_init':alps/kernel-3.10/drivers/misc/mediatek/accelerometer/qma6981/qma6981.c:2091:2: error: implicit declaration of function 'acc_driver_add' [-Werror=implicit-function-declaration]  acc_driver_add(&qma6981_init_info);  ^5. 报错信息为转义字符 - 服务器加密问题 - 重启编译服务器报错log: Line 2780: ./build/core/combo/include/arch/linux-arm/AndroidConfig.h:1:1: error: stray '\24' in programLine 2784: ./build/core/combo/include/arch/linux-arm/AndroidConfig.h:1:3: error: stray '#' in programLine 2787: ./build/core/combo/include/arch/linux-arm/AndroidConfig.h:1:1: error: unknown type name 'b'Line 2790: ./build/core/combo/include/arch/linux-arm/AndroidConfig.h:1:6: error: null character(s) ignored [-Werror]Line 2793: ./build/core/combo/include/arch/linux-arm/AndroidConfig.h:1:1: error: stray '\272' in programLine 2796: ./build/core/combo/include/arch/linux-arm/AndroidConfig.h:1:1: error: stray '\1' in programLine 2816: ./build/core/combo/include/arch/linux-arm/AndroidConfig.h:1:13: error: stray '\210' in programLine 2817: ./build/core/combo/include/arch/linux-arm/AndroidConfig.h:1:13: error: stray '\207' in programLine 2818: ./build/core/combo/include/arch/linux-arm/AndroidConfig.h:1:13: error: stray '\22' in programLine 2819: ./build/core/combo/include/arch/linux-arm/AndroidConfig.h:1:13: error: stray '\320' in program6. 两个.c文件中重复定义 - 修改其中一个名字报错log: alps/kernel/mediatek/custom/out/kernel/accelerometer/mxc622x.c:1319: multiple definition of `gsensor_operate'mediatek/custom/out/kernel/accelerometer/mxc400x.o:alps/kernel/mediatek/custom/out/kernel/accelerometer/mxc400x.c:1845: first defined heremake[4]: *** [mediatek/custom/out/kernel/built-in.o] Error 17. 编译服务器空间不足 - [No space left on device] - 清除服务器多余存储例1:cp: writing `out/target/product/magc6580_we_t_n/obj/EXECUTABLES/e2fsck_intermediates/quota.P': No space left on devicecp: failed to extend `out/target/product/magc6580_we_t_n/obj/EXECUTABLES/e2fsck_intermediates/quota.P': No space left on devicesed: couldn't write 47 items to stdout: No space left on device[ 53% 19897/36901] Export includes file:  -- out/target/product/magc6580_we_t_n/obj/EXECUTABLES/e2fsck_intermediates/export_includes[ 53% 19898/36901] target SharedLib: libart (out/target/product/magc6580_we_t_n/obj/SHARED_LIBRARIES/libart_intermediates/LINKED/libart.so)FAILED: /bin/bash -c "prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++ -nostdlib -Wl,-soname,libart.so -Wl,--gc-sections -shared  -Lout/target/product/magc6580_we_t_n/obj/lib out/target/product/magc6580_we_t_n/obj/lib/crtbegin_so.o   例2:FAILED: /bin/bash -c "out/host/linux-x86/bin/acp -fp out/target/product/magc6737m_65_n/obj/lib/libart.so out/target/product/magc6737m_65_n/system/lib64/libart.so"acp: failed writing 'out/target/product/magc6737m_65_n/system/lib64/libart.so': No space left on device[ 63% 28774/45356] target  C: racoon <= external/ipsec-tools/src/racoon/genlist.cFAILED: /bin/bash -c "(PWD=/proc/self/cwd prebuilts/misc/linux-x86/ccache/ccache prebuilts/clang/host/linux-x86/clang-2690385/bin/clang fatal error: error in backend: IO failure on output stream.[ 63% 28774/45356] target SharedLib: libart-compiler (out/target/product/magc6737m_65_n/obj/SHARED_LIBRARIES/libart-compiler_intermediates/LINKED/libart-compiler.so)FAILED: /bin/bash -c "prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++ -nostdlib -Wl,-soname,libart-compiler.so -Wl,--gc-sections -shared  -Lout/target/product/magc6737m_65_n/obj/lib out/target/product/magc6737m_65_n/obj/lib/crtbegin_so.o      out/target/product/magc6737m_65_n/obj/SHARED_LIBRARIES/libart-compiler_intermediates/compiled_method.o 8. BoardConfig.mk分区不足!!!默认的分区,及大小是写在alps/device/mediatek/build/build/tools/ptgen/MT6737M/partition_table_MT6737M.xls中此中方式只能修改大小,不能重新划分分区1. 修改alps/device/haocheng/hct6580_we_a_l/BoardConfig.mk 在最后添加:BOARD_MTK_SYSTEM_SIZE_KB :=  1835008// 需要比文件夹略大: alps\out\target\product\hct6580_weg_a_l\systemBOARD_MTK_USERDATA_SIZE_KB :=  786432// 注意大小是16的倍数2. rm –rf out\target\product\$PROJECT_NAME \obj\PTGEN// 里面有分区表,不删除不会生效3. source xxx; lunch xxx; make lk;// 重新生成 MT6580_Android_scatter.txt4. 查看【system】分区大小是否成功改变vi out/target/product/hct6580_weg_a_l/MT6580_Android_scatter.txtpartition_index: SYS19partition_name: system// 关键字[system]file_name: system.imgis_download: truetype: EXT4_IMGlinear_start_addr: 0xa800000physical_start_addr: 0xa800000-partition_size: 0x60000000// 原本报错的时候+partition_size: 0x70000000// 修改之后生成region: EMMC_USERstorage: HW_STORAGE_EMMCboundary_check: trueis_reserved: falseoperation_type: UPDATEreserve: 0x005. Make snod 或 make systemimagelog:Target system fs image: out/target/product/hct6580_weg_a_l/obj/PACKAGING/systemimage_intermediates/system.imgerror: ext4_allocate_best_fit_partial: failed to allocate 3060 blocks, out of space?error: failed to build out/target/product/hct6580_weg_a_l/obj/PACKAGING/systemimage_intermediates/system.img from out/target/product/hct6580_weg_a_l/systemRunning:  mkuserimg.sh -s out/target/product/hct6580_weg_a_l/system out/target/product/hct6580_weg_a_l/obj/PACKAGING/systemimage_intermediates/system.img ext4 system 1610612736 out/target/product/hct6580_weg_a_l/root/file_contextsOut of space? the tree size of out/target/product/hct6580_weg_a_l/system is (MB): 1511out/target/product/hct6580_weg_a_l/systemThe max is 1536 MB.make: *** [out/target/product/hct6580_weg_a_l/obj/PACKAGING/systemimage_intermediates/system.img] Error 1#### make failed to build some targets (01:03:06 (hh:mm:ss)) ####