MATLAB: How to get MCR to look for the MEX files in the current directory

compilerdeploymcrmex

I have included a mex file with my deployed app, but when running the mexed function, I get the error:
"An error occurred: Invalid MEX-file 'C:\Users\username\AppData\blahblahblah...': The specified module could not be found."
But I don't want to put my MEX file there: I want it in the same directory as my executable, where it's sitting right now. How can I get MCR to see it? =/
Cheers!

Best Answer

Hi,
this error means that some dependency of that mex file couldnt be found. This happens for example when you compile your mex files with VS 2010 express or SDK 7.1. They depend on the VS redistributable package 2010 which isn't shipped with the MCR.
So basically, install the redistributable package maching your compiler version and bitness.
In addition: If the MCR couldnt find your mex files, the error would be the unknown function or variable error.