ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

IAR报错:Error[Pa045]: function “halUartInit“ has no prototype

IAR报错:Error[Pa045]: function “halUartInit“ has no prototype

在IAR工程.c文件末尾添加一个自己的函数,出现了报错Error[Pa045]: function "halUartInit" has no prototype

意思是没有在开头添加函数声明,即void halUartInit(void);

这个问题我们在keil中不会遇到,这是因为IAR编译器规则的一个设置造成的。

解决办法:

法一(推荐):我们需要关闭Options->C/C++ Compiler->Language1中的Require Prototypes
在这里插入图片描述

法二:在.c文件添加函数声明
在这里插入图片描述

返回列表