When you build applications, associated shell scripts (
are automatically generated in the same folder as your binary. By
running these scripts, you can conveniently set the path to your MATLAB® Runtime location.
setenv command fails with a message
setenv: command not found or
not found, you are not using a C Shell command interpreter
Set the environment variables using the
using the format
For example, to set
the following command:
export DYLD_LIBRARY_PATH=mcr_root/v910/runtime/maci64:mcr_root/ ...
If you set your environment variables, you may still receive the following message when you run your application:
dyld: Library not loaded: @rpath/libmwlaunchermain.dylib Referenced from: /Applications/magicsquare/application/ magicsquare.app/Contents/MacOS/magicsquare Reason: image not found Trace/BPT trap: 5
You may have set your environment variables initially, but they were not set up as persistent variables. Do the following:
In your home directory, open a file such as
in your log-in shell.
In either of these types of log-in shell files, add
commands to set your environment variables so that they persist. For
example, to set
DYLD_LIBRARY_PATH in this manner,
you enter the following in your file:
# Setting PATH for MCR DYLD_LIBRARY_PATH=MCR_ROOT/v910/runtime/maci64: MCR_ROOT/v910/sys/os/maci64: MCR_ROOT/v910/bin/maci64 export DYLD_LIBRARY_PATH ?
DYLD_LIBRARY_PATH= statement is one statement
that must be entered as a single line. The statement is shown on different
lines, in this example, for readability only.