- MATLAB version incompatibility. For more information, see MEX Version Compatibility.
- Missing compiler run-time libraries. If your system does not have the same compiler that built the MEX file, see the Microsoft® MSDN® website for information about Visual C++® Redistributable Packages.
- Missing or incorrectly installed specialized run-time libraries. Contact your MEX file or library vendor.
Why do I receive a "specified module could not be found" error while running a MEX-file in MATLAB?
180 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2013 年 6 月 13 日
編集済み: MathWorks Support Team
2023 年 4 月 11 日
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.
採用された回答
MathWorks Support Team
2023 年 4 月 11 日
編集済み: MathWorks Support Team
2023 年 4 月 11 日
This dependency error indicates that MATLAB cannot find all .dll files referenced by the MEX file module "mexfilename".
Determine missing dependencies:
To resolve this error, find the names of the dependent libraries, and determine if they are present on your system and on the system path. To find library dependencies on Windows, you can use the third-party utility Dependency Walker: https://www.dependencywalker.com
See the following article for more details and options on Linux/MacOS:
For .dll files that the MEX file linked against when it was built, the .dll files must be on the system path or in the same folder as the MEX file.
Other possible causes:
MEX files might require additional libraries that are not linked to the MEX file. Failure to find one of these explicitly loaded libraries might not prevent a MEX file from loading, but prevents it from working correctly. The code that loads the libraries controls the search path used to find these libraries. The search path might not include the folder that contains the MEX file. Consult the library documentation on proper installation locations.
Possible reasons for failure include:
2 件のコメント
Eric
2015 年 6 月 4 日
Chad,
Thanks for the info. I also found libmex.dll and libmx.dll in the list reported by dependency walker and these weren't the problem either (for obvious reasons, perhaps).
-Eric
Oliver Woodford
2015 年 7 月 20 日
It would be much more helpful if the error message said which module was missing.
その他の回答 (1 件)
Jim Hokanson
2014 年 6 月 18 日
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Troubleshooting in MATLAB Compiler SDK についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!