Hi Ben,
Here is an existing MATLAB answer which should prove helpful for this issue: https://www.mathworks.com/matlabcentral/answers/522018-error-using-custom-c-code-simulation-library-with-simulink-and-stateflow
The issue you are encountering is related to the standard dynamic loader behavior on Linux. To resolve this, you need to ensure that the directory containing the shared libraries is included in your 'LD_LIBRARY_PATH’. This will allow the dynamic loader to locate and load the necessary library files.
You may follow these steps to add the required directory to your 'LD_LIBRARY_PATH':
1. Identify the Directory:Determine the directory where your custom library (`.dll` or `.so` file) is located.
2. Modify ‘LD_LIBRARY_PATH’:
i. Open a terminal window.
ii. Use the following command to add the directory to your LD_LIBRARY_PATH:
>> export LD_LIBRARY_PATH=/path/to/your/library:$LD_LIBRARY_PATH
3. Restart MATLAB:After updating the ‘LD_LIBRARY_PATH’, restart MATLAB to ensure the changes take effect.
Hope this helps!