Skip to main content
DReye.1
Associate
September 24, 2022
Solved

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

  • September 24, 2022
  • 1 reply
  • 4698 views

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

This topic has been closed for replies.

1 reply

DReye.1
DReye.1Author
Associate
September 25, 2022

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.

Pavel A.
Super User
September 25, 2022

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