搜索
bottom↓
回复: 1

IAR编译官方库的头文件出错,请问是什么的原因?

[复制链接]

出0入0汤圆

发表于 2017-5-16 16:22:26 | 显示全部楼层 |阅读模式
新建了一个空的工程文件,然后调用官方的库头文件gpio.h
编译后,在MCU的头文件msp430fr2633.h提示错误,很奇怪
不知道是什么原因
------------------------------------------------------------------------------
#include "io430.h"
#include "gpio.h"

void main( void )
{
  // Stop watchdog timer to prevent time out reset
  WDTCTL = WDTPW + WDTHOLD;
  
  while(1)
  {
  
  }
}
--------------------------------------------------------




   Standalone license - IAR Embedded Workbench for Texas Instruments MSP430
Error[Pe101]: "ADCCTL0_L" has already been declared in the current scope (at line 134 of "C:\Program  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 204
Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCCTL0_H" has already been declared in the current scope (at line 135 of "C:\Program  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 204
Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCCTL0" has already been declared in the current scope (at line 116 of "C:\Program Files  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 204
(x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCCTL1_L" has already been declared in the current scope (at line 172 of "C:\Program  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 206
Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCCTL1_H" has already been declared in the current scope (at line 173 of "C:\Program  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 206
Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCCTL1" has already been declared in the current scope (at line 152 of "C:\Program Files  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 206
(x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCCTL2_L" has already been declared in the current scope (at line 209 of "C:\Program  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 208
Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCCTL2_H" has already been declared in the current scope (at line 210 of "C:\Program  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 208
Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCCTL2" has already been declared in the current scope (at line 194 of "C:\Program Files  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 208
(x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCLO_L" has already been declared in the current scope (at line 227 of "C:\Program Files  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 210
(x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCLO_H" has already been declared in the current scope (at line 228 of "C:\Program Files  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 210
(x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCLO" has already been declared in the current scope (at line 224 of "C:\Program Files  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 210
(x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCHI_L" has already been declared in the current scope (at line 237 of "C:\Program Files  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 212
(x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCHI_H" has already been declared in the current scope (at line 238 of "C:\Program Files  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 212
(x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCHI" has already been declared in the current scope (at line 234 of "C:\Program Files  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 212
(x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCMCTL0_L" has already been declared in the current scope (at line 259 of "C:\Program  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 214
Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\io430fr2633.h")
Error[Pe101]: "ADCMCTL0_H" has already been declared in the current scope (at line 260 of "C:\Program  C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 214

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

阿莫论坛20周年了!感谢大家的支持与爱护!!

一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。

出0入0汤圆

发表于 2017-11-8 14:00:52 | 显示全部楼层
"io430.h"
   和 "gpio.h,两个文件有重复声明的变量,
你需要修改下。
     不是所有的官方头文件自己组合下,就可以使用的
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-3-29 13:11

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

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