2022-12-28 05:54 AM
Hello,
I have recently bought an evaluation board. The manufacturer provides a library and a Keil sample project, but I would like to integrate the library in a STM32 Cube project.
I found on the internet how to add a .lib file (www.eclipse.org/.../), but I am still getting the following errors:
<Project Folder>/<lib-name>.lib: error adding symbols: bad value
<Project Folder>/<lib-name>.lib:(pqlib_math_cmsis.o): .symtab local symbol at index 356 (>= sh_info of 178)
make: *** [makefile:75: <filename>.elf] Error 1
2022-12-29 02:36 AM
Hello @Inigo
under Project > Properties > C/C++ Build > Settings > Tool Settings > MCU GCC Linker > Libraries add the .a library name and the path to that file.
Note that you don't enter the "lib" prefix and the extension .a, e.g. when the filename is libmylib.a, enter mylib
Besides, under MCU GCC Compiler > Include paths add the path to the header files to make the compiler happy.
You may keep copies of the .a and .h files within the project folder tree or "out-of-tree" in a separate folder as you prefer.
Note that .a files may exist for different MCU/CPU architectures and ABIs like floating point. Make sure that you get the correct library linked in.
I hope my answer has helped you. When your question is answered please close this topic by marking as Best the reply that answered you, it will help others find that answer faster. Thanks for your contribution.
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-12-29 02:38 AM
> The manufacturer provides a library and a Keil sample project
Is the library pre-compiled with Keil compiler? If yes you need to rebuild it with gcc (CubeIDE) from source. It will be .a instead of .lib.
2022-12-29 07:08 AM
I guess so. I don't have the source code and I'm sure that the manufacturer won't share it.
2022-12-29 01:38 PM
2022-12-30 05:05 AM
I am using Keil community version and --elf option is not available with my license.
2023-01-04 10:00 AM
You just have to find a way to do that conversion once and then just continue using your normal version. For example, ask someone who has a more advanced version. Or be more creative...