I have to make a digital filter with a dsPIC30F4011 (I'm completely new to microcontrollers). I was reading the documentation about the DSP Library to figure out how to use it. I created a simple C program based on a piece of code I saw in the documentation:
#include <stdio.h>
#include <stdlib.h>
#include <p30F4011.h>
#include <dsp.h>
#include <xc.h>
int main(int argc, char** argv) {
fractional *dstV;
fractional srcV1[2] = {Q15(0.2), Q15(0.2)};
fractional srcV2[2] = {Q15(0.5), Q15(0.5)};
dstV = VectorAdd(2, dstV, srcV1, srcV2);
int n = 1;
return (EXIT_SUCCESS);
}
But when I build it, I get the following messages:
build/default/production/main.o(.text+0x22): In function `_main':
: undefined reference to `_VectorAdd'
make[2]: *** [dist/default/production/test-dspic.X.production.hex] Error 255
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-default.mk:135: fallo en las instrucciones para el objetivo 'dist/default/production/test-dspic.X.production.hex'
make[2]: se sale del directorio '/home/adrian/MPLABXProjects/test-dspic.X'
nbproject/Makefile-default.mk:90: fallo en las instrucciones para el objetivo '.build-conf'
make[1]: se sale del directorio '/home/adrian/MPLABXProjects/test-dspic.X'
nbproject/Makefile-impl.mk:39: fallo en las instrucciones para el objetivo '.build-impl'
BUILD FAILED (exit value 2, total time: 1s)
It says that the function VectorAdd
isn't defined. Is there something wrong or missing?