Showing results for 
Search instead for 
Did you mean: 

Adding external GCC libraries to STM32Cube project

Associate II


I was looking on some tutorials to do FFT on the NUCLEO-L476RG board, where they recomended using CMSIS DSP library. The DSP configuration guide from ST (link below) said to add the library path under Project Properties ->Tool Settings ->GCC Linker. The issue is the GCC Linker settings doesn't show up under Tool Settings in my project, as seen in the picture i've attached. I've tried adding it to the G++ Linker instead, but that didn't work, I suppose because the library is written for GCC.

Is there any other way to add libraries, or is there something i need to do to make this setting show up?

Link to guide:

Picture of tool settings:


Lead II

GCC linker can link C libraries.

GCC++ linker can link C and C++ libraries.

You get the GCC++ linker setting because probably you selected C/C++ at the project creation.

"but that didn't work"

What didn't work?

What dit you set in the setting windows (libraries and libraries path)?

Associate II

I can only see the G++ Linker, and not the GCC++ linker. Is it the same thing?

Adding the library to the G++ linker didn't work. I added the path to the CMSIS DSP Lib folder in the libraries library search path -L section of the G++ linker, as they instructed in the guide.


Include path0693W00000QLJdhQAH.pngLibrary and search path


0693W00000QLJeGQAX.pngError when trying to #include math library


Lead II

Libraries are different than sources files (.c, .cpp, .h).

If you have the library as object (.a or .lib) add the path in the library window of linker setting .

If the library is in source, add the source and incluse path as usual in the compiler setting.


Associate II

I have it as a .a file (libarm_cortexM4lf_math.a), so I added the containing folder under G++ Linker -> Library search path -> add. But it still says Unresolved inclusion: "arm_math.h" when i try to include it in main.

Lead II

Add the path to the library .h files to the incluse path of the compiler (double check the path!)

Add the path to the .a file to the library path of the linker library setting (-L)

Add the . a file to the linker library setting (-l)

Associate II

Tried remaking the project again, and it works now. I must have made a mistake in the project setup. Thanks for you help and patience!

I am facing same issue , how to resolve this Capture-2.PNGCapture.PNG