Other Parts Discussed in Thread: CCSTUDIO
Hi. As part of a project I am working on, I have written a function to average values from the ADC. My function is as follows:
float AdcAvg(float *AdcBuf)
{
static int Sum = 0;
static float Average = 0;
int i=0;
for (i=0;i<ADC_BUF_LEN;i++) {
Sum+=*AdcBuf;
}
return Average = Sum/ADC_BUF_LEN;
}
Everything compiles, builds, and runs fine with this. However, I need to change the variable Sum from an int to a float to get rid of roundoff errors. I make the correction as follows:
static float Sum = 0;
After I made the correction, I tried to rebuild the project. I get the following errors:
[Linking...] "C:\CCStudio_v3.3MCU\C2000\cgtools\bin\cl2000" -@"Debug.lkf"
<Linking>
warning: entry-point symbol "_c_int00" undefined
undefined first referenced
symbol in file
--------- ----------------
___memcpy_ff C:\\..\\Debug\\PieCtrl_5_6_7_8_9_10.obj
error: unresolved symbols remain
error: errors encountered during linking; "./Debug/Lab6.out" not built
I cannot figure out the correlation between changing the type of a variable and introducing unresolved symbols. I have the proper libraries linked (like I said, it compiles, builds, and runs just fine when Sum is declared as "int"). Any ideas?