Reputation: 35
I am attempting to run a standalone Unix executable generated from Simulink coder using the rsim.tlc target folder. I am using the Simulink coder to convert Simulink code to c code. When I run the executable on a computer without Matlab I get the following error: dyld: Library not loaded: @rpath/libmat.dylib Referenced from: /Users/MrX/Downloads/./myprogram Reason: image not found zsh: abort ./myprogram
I have tried to add the following files to the directory I am running the executable from : libmat.dylib and libmx.dylib but that does not seem to resolve the issue. Does anyone know how to solve this error?
Upvotes: 0
Views: 592
Reputation: 36710
Looks like you ended up using the MATLAB Compiler to generate your application. Such applications require the matlab compiler runtime (MCR) to run. Easiest solution is probably to install it on the system. An alternative would be to revisit your process and generate C/C++ code using only the MATLAB Coder / Simulink Coder. This process adds additional limitations because code can't be generated for every function or model, but if successful you could get rid of of the dependency to the MCR.
Upvotes: 2