如果打开 hello world 目录直接进行编译, 可以便正常编译并打印日志, 而如果
将 hello world 的 cmakelists. txt 修改为
list (APPEND ADD_SRCS
"src/main. c"
)
register_component () 之后, 使用 wm. py build 依然能正常编译, 但是编译出来后的固件烧录后起不来, 然后这时候撤销修改, 改回:
append_srcs_dir (ADD_SRCS "src"
)
register_component () 删掉 build 文件夹并重新执行 wm. py build 编译, 会出现找不到 main 的问题:
nt\wmclics\cmake\bin\cmake. exe -E echo " wm. py flash -p PORT" && cd /D E: \smart\Multi_chip_project\swarm_drones\x2481_cluster2\examples\hello_world\build && D: \software\development\wmclics\cmake\bin\cmake. exe -E echo ""
components/wm_system/libwm_system. a (wm_system. c. obj) : In function `wm_start_task':
E: /smart/Multi_chip_project/swarm_drones/x2481_cluster2/components/wm_system/src/wm_system. c: 370: undefined reference to `main'
E: /smart/Multi_chip_project/swarm_drones/x2481_cluster2/components/wm_system/src/wm_system. c: 370: (. text. wm_start_task+0x110) : relocation truncated to fit: R_CKCORE_PCREL_IMM26BY2 against undefined symbol `main'
collect2. exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.