c - 声明与“__interwork __vfp”不兼容
问题描述
我正在使用 C 语言使用 IAR Embedded Workbench。
我收到以下错误:
Error[Pe147]: declaration is incompatible with "__interwork __vfp void test()" (declared at line 1 of "C:\test_Project\test\EWARM/../Inc\test.h") C:\test_Project\test\Src\test.c 3
test.h 的内容:
void test();
test.c 的内容:
#include "test.h"
void test(UART_HandleTypeDef *huart, float *data, uint16_t send_size)
{
//omission
}
如果我删除uint16_t send_size
测试函数的参数,编译成功。
这怎么解释?
解决方案
该错误意味着在 test.h 中声明 test() 的方式与在 test.c 中实现的方式之间存在差异。您的函数参数必须匹配。
在 test.h 中,而不是
void test();
利用
void test(UART_HandleTypeDef *huart, float *data, uint16_t send_size);
推荐阅读
- css - 线性渐变在带有 scss 的 Angular 8 中不起作用
- python - 在 Python 中交换三个对象。为什么顺序相关?
- reactjs - 我有多个按钮,当用户单击一个按钮时,我希望该按钮具有某种背景颜色。我如何在反应中实现这一目标?
- arrays - 在定义为联合类型的属性上调用 .map()
- r - strsplit 会删除部分数据吗?
- email - 不推荐使用的功能:idn_to_ascii() Magento 2.3.1 和 PHP 7.2
- reactjs - 如何在地图之前删除重复的
- flutter - 如何运行 firstapp 颤振 1.5
- java - 在 Spring REST 控制器中获取表单数据 - 替代方案
- cordova - 'ionic cordova run android'构建失败 - 在离子 3