[技术问答] BSP库 IAR 编译报错

[复制链接]
2911|6
 楼主| zwj123000 发表于 2018-11-27 17:56 | 显示全部楼层 |阅读模式
Error[Pe235]: variable "__stdout" was declared with a never-completed type


xixi2017 发表于 2018-11-27 21:02 | 显示全部楼层
你程序中使用了这个变量了吗,或者这个结构体
另外是不是有头文件没有包含进来,或者你的变量名字写错了。
xixi2017 发表于 2018-11-27 21:03 | 显示全部楼层
C语言中的 stdout 是一个定义在<stdio.h>的宏(macro),它展开到一个 FILE* (“指向 FILE 的指针”)类型的表达式(不一定是常量),这个表达式指向一个与标准输出流(standard output stream)相关连的 FILE 对象。

所以你是不是没有包含这个stdio.h的头文件。
 楼主| zwj123000 发表于 2018-11-28 10:18 | 显示全部楼层
果断放弃IAR,还是用KEIL
734774645 发表于 2018-11-28 12:02 | 显示全部楼层
zwj123000 发表于 2018-11-28 10:18
果断放弃IAR,还是用KEIL

楼主你这因为IAR问题,还是你忘了包含stdio.h了?s
kobekai 发表于 2019-7-12 00:50 | 显示全部楼层
734774645 发表于 2018-11-28 12:02
楼主你这因为IAR问题,还是你忘了包含stdio.h了?s

新唐的底层库,同样的问题!
  1. #include <stdio.h>
  2. #include "Platform.h"

  3. #if defined ( __CC_ARM   )
  4. #if (__ARMCC_VERSION < 400000)
  5. #else
  6. /* Insist on keeping widthprec, to avoid X propagation by benign code in C-lib    */
  7. #pragma import _printf_widthprec
  8. #endif
  9. #endif

  10. /* Un-comment this line to disable all printf and getchar. getchar() will always return 0x00*/
  11. //#define DISABLE_UART
  12. //#define ENABLE_HARDFAULT_STACKDUMP
  13. /*---------------------------------------------------------------------------------------------------------   */
  14. /* Global variables                                                                                           */
  15. /*---------------------------------------------------------------------------------------------------------   */
  16. #if !(defined(__ICCARM__) && (__VER__ >= 6010000))
  17. struct __FILE {
  18.     int handle; /* Add whatever you need here */
  19. };
  20. #endif
  21. FILE __stdout;
  22. FILE __stdin;
yiyigirl2014 发表于 2019-7-16 11:01 | 显示全部楼层
kobekai 发表于 2019-7-12 00:50
新唐的底层库,同样的问题!

怎么就解决的?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

8

主题

48

帖子

3

粉丝
快速回复 在线客服 返回列表 返回顶部