aragon 发表于 2017-5-16 16:22:26

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

新建了一个空的工程文件,然后调用官方的库头文件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: "ADCCTL0_L" has already been declared in the current scope (at line 134 of "C:\ProgramC:\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: "ADCCTL0_H" has already been declared in the current scope (at line 135 of "C:\ProgramC:\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: "ADCCTL0" has already been declared in the current scope (at line 116 of "C:\Program FilesC:\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: "ADCCTL1_L" has already been declared in the current scope (at line 172 of "C:\ProgramC:\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: "ADCCTL1_H" has already been declared in the current scope (at line 173 of "C:\ProgramC:\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: "ADCCTL1" has already been declared in the current scope (at line 152 of "C:\Program FilesC:\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: "ADCCTL2_L" has already been declared in the current scope (at line 209 of "C:\ProgramC:\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: "ADCCTL2_H" has already been declared in the current scope (at line 210 of "C:\ProgramC:\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: "ADCCTL2" has already been declared in the current scope (at line 194 of "C:\Program FilesC:\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: "ADCLO_L" has already been declared in the current scope (at line 227 of "C:\Program FilesC:\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: "ADCLO_H" has already been declared in the current scope (at line 228 of "C:\Program FilesC:\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: "ADCLO" has already been declared in the current scope (at line 224 of "C:\Program FilesC:\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: "ADCHI_L" has already been declared in the current scope (at line 237 of "C:\Program FilesC:\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: "ADCHI_H" has already been declared in the current scope (at line 238 of "C:\Program FilesC:\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: "ADCHI" has already been declared in the current scope (at line 234 of "C:\Program FilesC:\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: "ADCMCTL0_L" has already been declared in the current scope (at line 259 of "C:\ProgramC:\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: "ADCMCTL0_H" has already been declared in the current scope (at line 260 of "C:\ProgramC:\Program Files (x86)\IAR Systems\Embedded Workbench 7.4\430\inc\msp430fr2633.h 214

lingergz 发表于 2017-11-8 14:00:52

"io430.h"
   和 "gpio.h,两个文件有重复声明的变量,
你需要修改下。
   不是所有的官方头文件自己组合下,就可以使用的
页: [1]
查看完整版本: IAR编译官方库的头文件出错,请问是什么的原因?