cancel
Showing results for 
Search instead for 
Did you mean: 

How to successfully add an static library to the project and liker in STM32CubeIDE

DReye.1
Associate

I have tried to add a library with .a extension but all tries had been unsuccessfully.

I have added the search path to "Library Search Path (L)" section in MCU GCC Linker.

I have added the library name to "Libraries (-l)" section in MCU GCC Linker.

With this when building the project, I get the next error:

tools\arm-none-eabi\bin\ld.exe: cannot find -lMyLibrary

Is there any other step I'm missing?

Hope you can help me with this.

Regards

1 ACCEPTED SOLUTION
3 REPLIES 3

Hi Pavel,

Thanks for your reply.

I was missing to set the expected naming convention. adding the prefix "lib" to the .a file solved the problem.

Thanks.

@DReye.1​ There also is a way to specify library names without prefix 'lib' but I cannot recall it.