Hi,
We would like to share a part of our Zephyr software with a customer. We would like to share a static library, not the source code. The code to be included in the static library is a few .c files and a few .h files.
The code starts some threads and has some internal logic, and of course a public interface for configuration, initialization, starting and stopping processes, etc. It also uses Zephyr kernel calls internally, like k_msgq_put(). This last call leads to problems:
Rebuilding ‘zephyr/zephyr_prebuilt.elf’ from solution ‘build’ in configuration ‘Common’ Compiling ‘empty_file.c’ Linking ‘zephyr_prebuilt.elf’ B 1 MB 1.92% B 448 KB 1.25% B 2 KB 4.30% lib/liblib.a(lib.c.obj): in function `k_msgq_put': undefined reference to `z_impl_k_msgq_put' ld returned 1 exit status Build failed
Please checkout this minimal reproducible example:
4456.with_source.zip
How do we solve this? We would like to be able to distribute the library after building it for the correct hardware board and project settings, so that someone else can just include it and use the functions defined in the header files in the include folder.