WCH沁恒单片机
直播中

刘刚

8年用户 1120经验值
私信 关注
[问答]

mounriver studio如何用c++编程?

将工程转化为c++后直接报错了
下面是报错提示。
18:36:31 **** Incremental Build of configuration obj for project CH573F ****
make -j12 all
c:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: ./StdPeriphDriver/CH57x_sys.o: in function `SYS_ResetExecute':
E:code_projectCH57X_testnew_testCH573Fobj/../StdPeriphDriver/CH57x_sys.c:148: undefined reference to `FLASH_EEPROM_CMD'
c:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: ./StdPeriphDriver/CH57x_sys.o: in function `HardFault_Handler':
E:code_projectCH57X_testnew_testCH573Fobj/../StdPeriphDriver/CH57x_sys.c:282: undefined reference to `FLASH_EEPROM_CMD'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:69: CH573F.elf] Error 1


18:36:32 Build Failed. 5 errors, 0 warnings. (took 378ms)
求指导
  

回帖(1)

郭武莱

2022-9-20 10:21:24
太正常了,extern函数对应的ISP573库没加,编译器原来是C Linker,现在是C++ Linker。
这些要自查一下,对应报错也显示是链接问题
你代码要是没变,全部的C文件还是C Compiler做的,include啥都不用改
如添加了cpp文件,就把c++ Compiler的include,预处理相关的填一下...
举报

更多回帖

发帖
×
20
完善资料,
赚取积分