syntax error - token “;“ inserted before “DummyAddr“ 问题及解决

工作记录

背景与工具

芯片型号: Infineon Tricore TC387
编译器: Tasking
编译出错:

ctc I805: ["..\src\User_src\src_Rte_NVMEXT\Rte_NvmName.h" 17/1] start of current external declaration
ctc E208: ["..\src\User_src\src_Rte_NVMEXT\Rte_NvmName.h" 18/14] syntax error - token ";" inserted before "Dem_Cfg_MemoryEntryInit"
ctc I805: ["..\src\User_src\src_Rte_NVMEXT\Rte_NvmName.h" 18/1] start of current external declaration

出错原因及解决

出错的源代码位置:

/**********************************************************************************
*    Includes
*********************************************************************************/

/**********************************************************************************/
/* Dummy Addr */
extern uint8 DummyAddr[28];
extern uint8 Dem_Cfg_MemoryEntryInit[28];

分析原因:
既然说在 DummyAddr 之前出现了一句话,没写分号。意味着在 DummyAddr 之前,有编译器未能识别的语句或者关键字。
本例中,通过查找分析,发现关键词 extern 是正确使用的,那么uint8 有可能是编译器未识别的。所以,找到 uint8 定义的位置,在 Platform_Types.h 中。故,添加该头文件定义即可。

解决方案为:在当前文件中添加头文件即可编译通过。

/*********************************************************************************
*    Includes
*********************************************************************************/
#include "Platform_Types.h"

/**********************************************************************************/
/* Dummy Addr */
extern uint8 DummyAddr[28];
extern uint8 Dem_Cfg_MemoryEntryInit[28];

或者将 uint8 变为编译器能识别的符号:

/*********************************************************************************
typedef unsigned char  uint8;    //或者进行 uint8 定义也可。
/**********************************************************************************/
/* Dummy Addr */
extern uint8 DummyAddr[28];
extern uint8 Dem_Cfg_MemoryEntryInit[28];

End of File.

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值