IAR EWARM 如何解决 Inconsistent wchar_t size 错误

在使用Nordic的NFC开发的时候,碰到了如题的错误,查找相关资料,发现如下的说明

Linker error Error[Lt009]: Inconsistent wchar_t size - Nordic Q&A - Nordic DevZone - Nordic DevZonehttps://devzone.nordicsemi.com/f/nordic-q-a/27260/linker-error-error-lt009-inconsistent-wchar_t-size

SDK 14.1 uses IAR Workbench 7.80.4 for testing and verification. IAR 7.x uses 16 bit wchar_t, but IAR 8.x uses 32 bit wchar_t. More information about this from IAR can be found here.

The SDK contains precompiled libraries, some of which are not open, which are built using IAR 7 with the wchar_t size of 16 bits. Since IAR 8 uses wchar_t size of 32 bits, there is a mismatch between the precompiled libraries and the newly compiled project code, and the build fails. SDK 14.1 is therefore not fully compatible with IAR 8.

进一步去release notes看,有如下说明

*****
Note for IAR 8 users:
(Libraries for IAR 8 require wchar_t to be of size 32 bits while IAR 7 requires 16 bits).
 
To run a project using IAR 8, follow these intructions:
 - Open the IAR project in IAR 8. The IAR workbench will automatically generate an IAR 8 compatible project file.
 - If the project contains one of the precompiled libraries listed below, replace it
   with the IAR 8 compatible alternative (there are no projects targeting nRF51 in this SDK).
 - Save the project.
 - When building the project, you might get the warning: "The header file 'cmsis_iar.h' is obsolete and should not be used. [...]".
    - The problem is described in DevZone post: https://devzone.nordicsemi.com/f/nordic-q-a/31123/iar-ewarm-8-22-1-complains-about-cmsis_iar-h
      The solution is to remove all occurrences of #include <cmsis_iar.h>.
    
The affected libraries are:
 - micro-ecc crypto:
    - IAR7: Includes library located in the folder named “…_iar\…”.
    - IAR8: Switch to using the library from the folder named “…_armgcc\…”.
 - nrf_cc310, nrf_cc310_bl, and nrf_oberon:
    - IAR7: Link to a library where “short_wchar” is part of the folder name.
    - IAR8: Link to a library without “short_wchar” in part of the folder name.
 - Gazell, NFC Tag, and 802.15.4:
    - IAR7: Includes the library where the file name ends with “_iar”.
    - IAR8: Switch to using the library with similar file name that ends with “_gcc”.
*****

而在IAR的官方说明中也有相关说明

 最后解决方法为:将 nfc_t4t_lib_iar 替换为 nfc_t4t_lib_gcc

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Tristan Tsai

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值