Why do I receive a "specified module could not be found" error while running a MEX-file in MATLAB?
Show older comments
When I try to run a MEX file in MATLAB, I receive the following error:
ERROR: Invalid MEX-file 'mexfilename': The specified module could not be found.
where "mexfilename" is the name of my MEX-file. However, I did not receive any errors when compiling the file.
Accepted Answer
More Answers (1)
Jim Hokanson
on 18 Jun 2014
3 votes
In my case I needed to install a Visual Studio redistributable Package that matched the version used when compiling the libraries I was linking against. A Google search "Visual Studio redistributable 2012" provided the link to the installer I needed. Once this was installed I could compile directly from Matlab. I am guessing that if I had compiled from inside visual studio instead of from within Matlab things would have worked as well.
Categories
Find more on C Shared Library Integration 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!