2022-10-12 06:42 AM
2022-10-18 05:22 PM
You're making a static library (.a), not a .so. Visibility of publics applies only to exports of shared libraries.
2022-10-14 03:32 AM
Hello @OBorg.1
First let me thank you for posting.
I am trying to investigate this issue and it would be very helpful if you provide me with:
I will be waiting for your feedback.
Kind regards,
Semer.
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-10-14 03:46 AM
Here are the other GCC settings:
-mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32G431xx -c -I../Drivers/CMSIS/Device/ST/STM32G4xx/Include -I../Drivers/CMSIS/Include -I../Inc -I../Drivers/STM32G4xx_HAL_Driver/Inc -I../Drivers/STM32G4xx_HAL_Driver/Inc/Legacy -I"C:\Users\TE228673\SW_Dev\STM32CubeIDE\workspace_1.7.0\KMX-D\DESIGN_DEMOS\PRIVATE_INCLUDE_FILE_TEST_LIB\Module\PrivateLogicFunctions\Inc" -I"C:\Users\TE228673\SW_Dev\STM32CubeIDE\workspace_1.7.0\KMX-D\DESIGN_DEMOS\PRIVATE_INCLUDE_FILE_TEST_LIB\Module\PublicLogicFunctions\Inc" -O0 -ffunction-sections -fdata-sections -Wall -fvisibility=hidden -v -fstack-usage --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb
I am creating a static-lib project.
This project contains a lot of functions for internal use only. These functions MUST NOT be callable from outside the static lib.
Referring the: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options
This can usually be achieved by simply using the GCC flag:
-fvisibility=hidden
Unfortunately, this flag does not work in my project in CubeIde.
2022-10-18 07:12 AM
Hello,
Unfortunately I still haven't found a solution to my problem.
I am looking for a solution in CubeIDE for the following situation:
I need to create a library which:
* implemented some functions that need to be callable from outside
* numerous functions implemented that must NOT be accessible from outside
I have to integrate this library later in an executable project.
How can I achieve this?
2022-10-18 05:22 PM
You're making a static library (.a), not a .so. Visibility of publics applies only to exports of shared libraries.
2022-10-18 10:04 PM
Hello Pavel,
Many thanks for the explanations.
How is a requirement like mine implemented?
(This should be a common use case.)
2022-10-18 10:17 PM
Maybe some more background information will help:
The code (several libraries) that I create should later be used in various executable MCU projects (by other developers) in the simplest possible way.
In order to prevent manipulation of the code, the actual C code must not be distributed.
(Hence my idea to use .a file(s))