I have C application which uses two **static** libraries. Source code for these libraries are generated and built by Simulink/MATLAB.
The problem is that Simulink generates **extern non-static** function
`real_T rt_urand_Upu32_Yd_f_pw(uint32_T *u)` for block "Uniform Random Number" into the file MyModel.c for each model. And when I include these libraries in my C application I got linker error of function redefinition.
Is there any way to change code generation process in Simulink?
This is a duplicate symbol issue in C because both static libraries define the same function with external linkage. I'd go into Simulink's Code Generation → Interface settings and change Shared code placement to Shared location. This allows both models to use a common utility library, which you can link once instead of having two definitions of the same function.