mounriver studio 如何用c++编程

按照视频教程将工程转化为c++后直接报错了

(https://www.bilibili.com/video/BV1wd4y1A76i/?vd_source=50c583a4cce55f32afa627ae22e41526)

下面是报错提示。

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_project\CH57X_test\new_test\CH573F\obj/../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_project\CH57X_test\new_test\CH573F\obj/../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)

求指导

太正常了,extern函数对应的ISP573库没加,编译器原来是C Linker,现在是C++ Linker。

这些要自查一下,对应报错也显示是链接问题

你代码要是没变,全部的C文件还是C Compiler做的,include啥都不用改

如添加了cpp文件,就把c++ Compiler的include,预处理相关的填一下...



懂了


给补充一张配置照片,其实就是切换后注意保持原先的工程配置就行了。image.png


只有登录才能回复,可以选择微信账号登录