设备开发编译报错【riscv32-unknown】【命名规范】【hi3861设备开发】【原因之一】

hm688c7200ba143
发布于 2025-10-17 11:22
浏览
0收藏

设备开发编译报错【riscv32-unknown】【命名规范】【hi3861设备开发】【原因之一】-鸿蒙开发者社区cke_2623.png

[命名单一会报错]:

......

oal_util.c:(.text.oal_print_hex_dump+0x0): multiple definition of `oal_print_hex_dump'; build/libs/hi3861/release/no_mesh/libwifi.a(oal_util.o):oal_util.c:(.text.oal_print_hex_dump+0x0): first defined here

riscv32-unknown-elf-ld: output/bin/Hi3861_wifiiot_app.out section ​​.text_rom' will not fit in region ​​ROM_TEXT'

riscv32-unknown-elf-ld: output/bin/Hi3861_wifiiot_app.out section ​​.bss_rom' will not fit in region ​​ROM_BSS'

riscv32-unknown-elf-ld: section .data_rom0 LMA [000000000040d3a0,000000000040d3a7] overlaps section .text_rom LMA [00000000003c7bc0,00000000004117df]

riscv32-unknown-elf-ld: region `ROM_TEXT' overflowed by 17472 bytes

riscv32-unknown-elf-ld: region `ROM_BSS' overflowed by 1156 bytes

scons: *** [output/bin/Hi3861_wifiiot_app.out] Error 1

BUILD FAILED!!!!

Failed building output/bin/Hi3861_wifiiot_app.out: Error 1

Traceback (most recent call last):

File "../../build/lite/build_ext_components.py", line 64, in

sys.exit(main())

File "../../build/lite/build_ext_components.py", line 58, in main

cmd_exec(args.command)

File "../../build/lite/build_ext_components.py", line 32, in cmd_exec

raise Exception("{} failed, return code is {}".format(cmd, ret_code))

Exception: ['sh', 'hm_build.sh'] failed, return code is 2

ninja: build stopped: subcommand failed.


[正确做法]:

设备开发编译报错【riscv32-unknown】【命名规范】【hi3861设备开发】【原因之一】-鸿蒙开发者社区cke_4047.png

复杂化命名。

【总结】:若遇到编译错误,在确保代码没问题的情况下,

BUILD.gn命名不要单一化,最好组合单词或自定义命名。

收藏
回复
举报
回复
    相关推荐