MDK从4.7升级到5.1,怎么以前的工程提示错误了

[复制链接]
2195|9
 楼主| 花落辞殇 发表于 2015-12-9 21:59 | 显示全部楼层 |阅读模式
  1. compiling main.c...
  2. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  3.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  4. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  5.   } IRQn_Type;
  6. Source\User\main.c: 1 warning, 1 error
  7. compiling Init.c...
  8. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  9.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  10. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  11.   } IRQn_Type;
  12. Source\User\Init.c: 1 warning, 1 error
  13. compiling Delays.c...
  14. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  15.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  16. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  17.   } IRQn_Type;
  18. Source\User\Delays.c: 1 warning, 1 error
  19. compiling TIM_x.c...
  20. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  21.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  22. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  23.   } IRQn_Type;
  24. Source\User\TIM_x.c: 1 warning, 1 error
  25. compiling AD_x.c...
  26. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  27.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  28. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  29.   } IRQn_Type;
  30. Source\User\AD_x.c: 1 warning, 1 error
  31. compiling PrintProcessings.c...
  32. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  33.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  34. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  35.   } IRQn_Type;
  36. Source\User\PrintProcessings.c: 1 warning, 1 error
  37. compiling HZlib.c...
  38. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  39.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  40. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  41.   } IRQn_Type;
  42. Source\User\HZlib.c: 1 warning, 1 error
  43. compiling Usart1.c...
  44. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  45.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  46. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  47.   } IRQn_Type;
  48. Source\User\Usart1.c: 1 warning, 1 error
  49. compiling Usart2.c...
  50. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  51.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  52. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  53.   } IRQn_Type;
  54. Source\User\Usart2.c: 1 warning, 1 error
  55. compiling Usart3.c...
  56. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  57.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  58. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  59.   } IRQn_Type;
  60. Source\User\Usart3.c: 1 warning, 1 error
  61. compiling RefreshPrint.c...
  62. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  63.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  64. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  65.   } IRQn_Type;
  66. Source\User\RefreshPrint.c: 1 warning, 1 error
  67. compiling PrintEndProcess.c...
  68. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  69.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  70. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  71.   } IRQn_Type;
  72. Source\User\PrintEndProcess.c: 1 warning, 1 error
  73. compiling AlarmProcess.c...
  74. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  75.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  76. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  77.   } IRQn_Type;
  78. Source\User\AlarmProcess.c: 1 warning, 1 error
  79. compiling SpecialSymbol.c...
  80. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  81.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  82. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  83.   } IRQn_Type;
  84. Source\User\SpecialSymbol.c: 1 warning, 1 error
  85. compiling misc.c...
  86. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  87.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  88. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  89.   } IRQn_Type;
  90. Source\Libraries\STM32F10x_StdPeriph_Driver\src\misc.c: 1 warning, 1 error
  91. compiling stm32f10x_rcc.c...
  92. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  93.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  94. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  95.   } IRQn_Type;
  96. Source\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c: 1 warning, 1 error
  97. compiling stm32f10x_gpio.c...
  98. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  99.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  100. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  101.   } IRQn_Type;
  102. Source\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c: 1 warning, 1 error
  103. compiling stm32f10x_tim.c...
  104. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  105.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  106. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  107.   } IRQn_Type;
  108. Source\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c: 1 warning, 1 error
  109. compiling stm32f10x_flash.c...
  110. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  111.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  112. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  113.   } IRQn_Type;
  114. Source\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c: 1 warning, 1 error
  115. compiling stm32f10x_i2c.c...
  116. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  117.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  118. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  119.   } IRQn_Type;
  120. Source\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c: 1 warning, 1 error
  121. compiling stm32f10x_usart.c...
  122. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  123.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  124. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  125.   } IRQn_Type;
  126. Source\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c: 1 warning, 1 error
  127. compiling stm32f10x_adc.c...
  128. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  129.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  130. .\Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  131.   } IRQn_Type;
  132. Source\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c: 1 warning, 1 error
  133. compiling system_stm32f10x.c...
  134. Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(298): error:  #67: expected a "}"
  135.     ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global Interrupt                       */
  136. Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(472): warning:  #12-D: parsing restarts here after previous syntax error
  137.   } IRQn_Type;
  138. Source\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c: 1 warning, 1 error
  139. ".\Obj\103RE_安卓_Print1.axf" - 23 Error(s), 23 Warning(s).
  140. Target not created
错误太多了,以前是好好的呀。

Boooooosh 发表于 2015-12-10 21:34 | 显示全部楼层
我觉得是库版本不兼容的问题
Elric_QZH 发表于 2015-12-11 23:03 | 显示全部楼层
估计是库头文件变了,找原来的头文件过来吧。
zhangyi3312 发表于 2015-12-12 22:50 | 显示全部楼层
我碰到相同的问题,解决方法如下:打开C:\Keil\UV4\PackInstaller.exe,然后在Packs选项中找到Keil::STM32F1xx_DFP单击前面的+号展开,选中1.0.2点击后面的卸载按钮,卸载后编译就正常。
具体什么原因不知.
爱潜泳的鱼 发表于 2015-12-13 10:58 | 显示全部楼层
error:  #67: expected a "}"这个错误
C/C++选项卡里的define有问题
会飞的大白 发表于 2015-12-13 19:22 | 显示全部楼层
cpu型号  下载选的哪个内存大小的那个文件,还有这个md  hd 这三个要对应
在C/C++选项卡里,把STM3210X_HD从prepocessor symbol define 里面删掉
大白农 发表于 2015-12-14 20:11 | 显示全部楼层
zhangyi3312 发表于 2015-12-12 22:50
我碰到相同的问题,解决方法如下:打开C:\Keil\UV4\PackInstaller.exe,然后在Packs选项中找到Keil::STM32F ...

这么做的原因:在老版本的官方STM32F10X.H文件里,这句话不是这么写的,若没记错的话,是
...&&!defined(STM32F10X_HD) && ...
原来是有括号的,不做标识符来处理,而新版的,如图,直接说明了出来,那就没有必要,可以根据C/C++知识自己去推断;
新人求带 发表于 2015-12-15 22:22 | 显示全部楼层
只要把  c/c++那个栏目中的  define的 芯片密度类型改了即可
Classover 发表于 2015-12-18 20:32 | 显示全部楼层
在MDK5中要注意:C/C++选项中的Defina  STM32F10X_HD/MD/LD 一定要和目标芯片FLASH的情况严格对应,否则会出现上述报错
Dennis-Zhou 发表于 2015-12-19 14:47 | 显示全部楼层
在MDK5中要注意:C/C++选项中的Defina  STM32F10X_HD/MD/LD 一定要和目标芯片FLASH的情况严格对应,否则会出现上述报错
您需要登录后才可以回帖 登录 | 注册

本版积分规则

11

主题

103

帖子

0

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