multiple definition of `xxx': CMSIS library multiple definition problem

phenomenon

When compiling the CMSIS library with arm-none-eabi-gcc, the DSP module is included. When the compiled .a static library is linked to the APP program, an error "multiple definition of `xxx'" appears.

the reason

In the current CMSIS code version DSP library, each subdirectory under Source contains a special c file, which "#include" contains all other c files in the current directory.
Therefore, these c files are actually compiled and linked twice.

Solution 1

Delete the c files corresponding to all subdirectories under the DSP library Source, such as "BasicMathFunctions.c" in the "BasicMathFunctions" directory.

Solution 2

Only these special files are included in the compiled SRC variables. The resulting static library only compiles these files once.

Guess you like

Origin blog.csdn.net/jimaofu0494/article/details/102561123