Problem with "undefined reference to" [SOLVED]
Hello,
I know that this question has been posted many times, but none of the proposed solutions have worked.
The problem I have should be easy to fix, bu I cannot find the way to do it. I have tried many ways to do the same thing, but all of them lead to the same problem, which is:
I:/Ac6/SystemWorkbench/workspace/nz32-sc151-fir_example/Src/main.cpp:174: undefined reference to `arm_snr_f32(float*, float*, unsigned long)’
collect2.exe: error: ld returned 1 exit status
The function arm_snr_f32 is defined in math_helper.h and implemented in math_helper.c. Files can be found on: https://github.com/ARM-software/CMSIS_5/tree/develop/CMSIS/DSP/Examples/ARM/arm_fir_example
The files are in a folder called Inc in my project’s workspace. Then, in the project explorer, I linked this folder and its files. I have also added the folder in Project properties > C/C++ General > Path and Symbols: “${WorkspaceDirPath}/.../Inc”
When I build the project, I see in the Debug folder that the object file math_helper.o is being created. However, my main.cpp program complains again and again.
Other things I have tried are e.g., creating a header file with the definition of some function and another source file with the implementation, both in the same src folder where my main.cpp is located. It can find the header, but when it comes to building the project successfully, reference error.
I would very much appreciate any help here.
Many thanks
David