Home > Back-end >  IAR has stated the external variables in functions but errors Undefined external "arr" ref
IAR has stated the external variables in functions but errors Undefined external "arr" ref

Time:01-24


extern unsigned long arr [5].
Unsigned long linearization (void)
{

Unsigned long temp=0;//the median temperature voltage

//selection,
for (int i=0; i<5;//ADCN i++) is the number of data collected by
{
Int k=I;
For (int j=I + 1; j<6; J++)
{
If (arr [j] K=j;
}
If (k!=I)
{
Temp=arr [k].
Arr=arr [k] [I];
Arr=\ [I];
}
}
Temp=arr [3].//return value
Return temp.
}

Error
Undefined external "arr" referred in lvbo (C: \ Users \ central astri \ Desktop1.22 (23:00) 1.22 (23:00) \ \ Debug \ Obj \ lvbo r43)
Why is this?

CodePudding user response:

The compiler does not find it,

CodePudding user response:

You have to put the extern unsigned long arr [5]. The outside of the array. C. h file imports come in, or do not know on which to find,

CodePudding user response:

I was defined in the c file. C file can refer to?

CodePudding user response:

Compile time not out of the error, connect you need to make sure all the target file related to connect to come in,

CodePudding user response:

Or your project/project reference file is not complete, is not the source of writing,
  • Related