2024-05-15 07:48 AM
Hello All,
I am trying to include arm_math.h for STM32F401RE project, I have all the source file of math.h
However when I try to build it. I am getting multiple defination error at linking stage.
Can anyone suggest me how to solve this?
I am not trying to add the lib. But I want to understand how to add the source files of arm_math.h.
Thank you
2024-05-15 07:51 AM
When you get a 'Multiple Definition' error, it tells you where both of the definitions are - so remove one!
Copy & paste the complete error as text rather than an image.
2024-05-15 08:10 AM - edited 2024-05-15 08:15 AM
Hello Andrew,
you are right. However when I search for the mentioned function, there is only one defination.
D:/Newton/Courses/Digital Signal Processing/Coding/HAL_WITH_ARM_MATH_H/Debug/..
/Drivers/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c:211:
multiple definition of `arm_split_rfft_q31';
./Drivers/CMSIS/DSP/Source/TransformFunctions/TransformFunctions.o:
D:/Newton/Courses/Digital Signal Processing/Coding/HAL_WITH_ARM_MATH_H/Debug/
../Drivers/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c:211:
first defined here
Here is the error. I am not able to make any sense out of it. Could you please help me with it?
2024-05-15 08:34 AM - edited 2024-05-15 08:35 AM
D:/Newton/Courses/Digital Signal Processing/Coding/HAL_WITH_ARM_MATH_H/Debug/../Drivers/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c:211: multiple definition of `arm_split_rfft_q31'; ./Drivers/CMSIS/DSP/Source/TransformFunctions/TransformFunctions.o: D:/Newton/Courses/Digital Signal Processing/Coding/HAL_WITH_ARM_MATH_H/Debug/../Drivers/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c:211: first defined here
So it's telling you that you have multiple definitions of arm_split_rfft_q31
And it tells you that one definition is in the file TransformFunctions.o
And the other definition is in the file arm_rfft_q31.c at line 211
Now TransformFunctions.o is a pre-built binary file, and arm_rfft_q31.c is a C source file
You need to choose either one or the other - you can't have both in your Project!
2024-05-15 08:54 AM
Thank you for breaking down the problem.
I found that in Transform.c all the .c are included
Since DSP is a standard library I believe I should not be modifying it.
Please suggest me how can I resolve this error?
2024-05-15 09:00 AM
@NNada.1 wrote:Please suggest me how can I resolve this error?
Again, you need to choose either one or the other - you can't have both in your Project!
There's a knowledgebase article on how to set up the DSP libraries:
https://community.st.com/t5/stm32-mcus/configuring-dsp-libraries-on-stm32cubeide/ta-p/49637