AnsweredAssumed Answered

Has already been declared in current scope : ERROR

Question asked by parthiban.kunal on Feb 8, 2013
Latest reply on Feb 8, 2013 by Clive One

In pal.h
{...............
................
.............
typedef enum   {


    PAL_IOLSTATE_NOREQUEST,
    PAL_IOLSTATE_ACTIVE_REQUEST,
    PAL_IOLSTATE_APP_ACTIVE
} pal_RequestState_t;



extern pal_RequestState_t pal_eRequestState ;
..........
............
;}
in main.c
{
#include "pal.h"
#include "stm32f10x_conf.h"
#include "datatypes.h"



#include <stdlib.h>
code........
...........
............
............
pal_RequestState_t  pal_eRequestState = PAL_IOLSTATE_NOREQUEST;


}





In one of my codes written IAR workbench C++ IDE for microcontroller STM32F100, after compiling i am getting a syntax error as:----

Error[Pe256]: invalid redeclaration of type name "pal_RequestState_t" 
Error[Pe101]: "PAL_IOLSTATE_NOREQUEST" has already been declared in the current scope 
Error[Pe101]: "PAL_IOLSTATE_ACTIVE_REQUEST" has already been declared in the current scope (at line 487) 
Error[Pe101]: "PAL_IOLSTATE_APP_ACTIVE" has already been declared in the current 


I am not able to figure out the error as there exists no other instance where i have declared these enum variables. I wonder if it is related to compiler settings.Please excuse me if i have insufficient information here as i af just shown a part of the code which needs to be verified.
Can anyone help me  with this error???

Outcomes