Ok so the only needed dll in the exe directory is libsim.dll. My first test was using both libsim.dll and mclmcrrt7_17.dll. It's mclmcrrt7_17.dll that was causing all the trouble.
libsim.dll automatically looks for the runtime dependency in the MATLAB Compiler Redistributable directory (which must be installed on the client library). But it looks first in the current directory.
My guess is redistribuable dlls are expecting to be loaded from the redistributable directory. Since I've copied them to the exe directory, it was loading them from there instead which doesn't work.
So, you only need to:
- install the right MATLAB redistributable
- put the dll produced by MATLAB (libsim.dll in this case) in the exe directory
Best Answer