如果打開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.