查看: 1641|回复: 0
打印 上一主题 下一主题

IAR 编译出错“declaration is incompatible with ”的解决方法

[复制链接]
跳转到指定楼层
沙发
发表于 2016-4-1 18:07:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
安装新版本后,IAR库和STM32库不兼容,会导致编译时出现“declaration is incompatible with ”等一堆错误,如下:

Building configuration: app - Debug
Updating build tree...
at24c16.c  
Error[Pe147]: declaration is incompatible with "__nounwind __interwork __softfp unsigned long __get_PSP(void)" (declared at line 52 of "C:\Program Files  C:\Users\Administrator.EOEWQ4H5V1I17GH\Desktop\W5500_HTTPS\W5500_HTTPS\source\Libraries\CMSIS\CM3\CoreSupport\core_cm3.h 1086
(x86)\IAR Systems\Embedded Workbench 7.0\arm\inc\c\intrinsics.h")
Error[Pe147]: declaration is incompatible with "__nounwind __interwork __softfp void __set_PSP(unsigned long)" (declared at line 53 of "C:\Program Files  C:\Users\Administrator.EOEWQ4H5V1I17GH\Desktop\W5500_HTTPS\W5500_HTTPS\source\Libraries\CMSIS\CM3\CoreSupport\core_cm3.h 1096
(x86)\IAR Systems\Embedded Workbench 7.0\arm\inc\c\intrinsics.h")
Error[Pe147]: declaration is incompatible with "__nounwind __interwork __softfp unsigned long __get_MSP(void)" (declared at line 50 of "C:\Program Files  C:\Users\Administrator.EOEWQ4H5V1I17GH\Desktop\W5500_HTTPS\W5500_HTTPS\source\Libraries\CMSIS\CM3\CoreSupport\core_cm3.h 1106
(x86)\IAR Systems\Embedded Workbench 7.0\arm\inc\c\intrinsics.h")

此处省备N多错误

Error while running C/C++ Compiler

Total number of errors: 180
Total number of warnings: 0

此种问题的解决方法:

把core_cm3.h里面这句给注释掉,然后加上一句
#if defined (__ICCARM__)
//#include <intrinsics.h>                     /* IAR Intrinsics   */
__intrinsic void __DSB(void);
#endif
完全没有任何警告和错误。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 加入中科因仑

本版积分规则

快速回复 返回顶部 返回列表