How do I get MCR to look for my MEX files in the current directory?

1 view (last 30 days)
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!
  1 Comment
Geoff
Geoff on 3 Feb 2012
Hmm, actually I checked that directory and I see that it's just a cache. MCR copies in my MEX file even if I haven't supplied it, so I assume it's part of my deployed executable.
The file is sitting exactly where MCR says that it cannot be found.
Anybody know what might be going on?

Sign in to comment.

Accepted Answer

Friedrich
Friedrich on 3 Feb 2012
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.
  2 Comments
Geoff
Geoff on 6 Feb 2012
Thank you for that. It turns out I had only installed the x86 redistributables on my target machine. After installing the x64 package, the error went away =)
Brendan
Brendan on 6 Nov 2013
THANK YOU!
I've been searching many forums and running Dependency Walker to no avail. It turns out that the target machine simply needed SDK 7.1. Now my deployed software is running marvelously.
You made my day!

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!