2024-02-26 04:31 AM
Hi. I have seen several tutorials and read in the forum how to include a library. But it does not work. Can someone help me please.
Solved! Go to Solution.
2024-03-04 07:54 AM - edited 2024-03-04 07:55 AM
https://community.st.com/t5/stm32cubeide-mcus/include-a-library/m-p/646526/highlight/true#M24844
You'll also have to study the Pack's documentation on how to use it ...
2024-02-26 05:08 AM - edited 2024-02-26 05:10 AM
Hello @Giuseppe1
Can you take a look at the following article and this post. It may be helpful.
Best Regards.
STTwo-32
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.
2024-02-26 05:11 AM
Hi,
maybe error msg is right ? There is no such file...
So you have to "import" it : right click on the directory, you want it to be ->
next -> browse the source , select what want - ready.
This for every source .c or .h (or group of ..) , then the IDE got it.
2024-03-04 04:28 AM
I created a new folder with the library(.h). Then i imported it : Project->Properties->MCU GCC linker->libraries. but it doesn't work.
2024-03-04 04:35 AM - edited 2024-03-04 04:36 AM
A header file is not a library - it just defines the interface to the library.
So, in addition to that header, you will also need the library code itself - either as a pre-built binary, or as source code.
2024-03-04 06:33 AM
2024-03-04 07:10 AM - edited 2024-03-04 07:32 AM
It is "source code" in that it is used as input to the compiler. It's not a binary file.
But, again, it's just a header file - as it says, it only contains prototypes - not the functions themselves:
* @brief This file contains all the functions prototypes for the
* lsm6dso_reg.c driver.
You also need something which contains the actual implementations of those functions - either as source code, or a pre-built binary.
I suggest you look at the X-CUBE-MEMS1 and/or C-Driver-MEMS software packs:
https://www.st.com/en/mems-and-sensors/lsm6dso.html#tools-software
EDIT
For a better understanding of the difference between declarations and definitions, and how data & functions can be defined in one file, but used in another, see:
2024-03-04 07:30 AM
2024-03-04 07:54 AM - edited 2024-03-04 07:55 AM
https://community.st.com/t5/stm32cubeide-mcus/include-a-library/m-p/646526/highlight/true#M24844
You'll also have to study the Pack's documentation on how to use it ...
2024-03-04 08:00 AM
Thanks!