Compiled Matlab Stand Alone app does not find a mex file

15 ビュー (過去 30 日間)
youngz
youngz 2021 年 1 月 31 日
回答済み: Shivam Lahoti 2025 年 3 月 10 日
Hi there,
I have developed a matlab app which uses a set of external functions. In turn, one of these functions uses the Screen function of Pyschtoolbox package. When I use the build in Run of matlab (to test the app) everything works fine. However, when I compile the app and I install it as stand alone, it does not work.
Then, with a try catch, I have printed the error in a text area:
MATLAB:mex:ErrInvalidMEXFile -- Invalid MEX-file 'C:\Users\myusername\AppData\Local\Temp\myusername\mcrCache9.8\myapp0\myapp\Screen.mexw64': Cannot find the specified module.
I have added the Screen.mexw64 to the list of "Files required for your application to run" and, indeed, if I look in the above mentioned path, I am able to find the Screen.mexw64 file.
Have you any solution?
Thanks :)
  3 件のコメント
youngz
youngz 2021 年 1 月 31 日
編集済み: youngz 2021 年 1 月 31 日
There is a way to identify the dependencies of a specific mex function?

サインインしてコメントする。

回答 (1 件)

Shivam Lahoti
Shivam Lahoti 2025 年 3 月 10 日
Hi youngz,
I understand you are getting a "MATLAB:mex:ErrInvalidMEXFile" error.
I can see a probable solution discussed in comments. However, this could be two of the possible solutions as well:
  1. If the application functions correctly on the computer where the MEX-file was compiled but not on another machine, consider recompiling the MEX-file on the new machine.
  2. This error may also occur if the Visual C++ redistributable is missing, leading to a dependency issue.
To identify missing library dependencies, download "Dependency Walker" from the following link: http://www.mathworks.com/help/matlab/matlab_external/invalid-mex-file-error.html
Install one of the supported versions of the compiler (Microsoft Visual C++ only) on the machine, which will automatically install the redistributable. You can find the list of supported compilers here: https://www.mathworks.com/support/requirements/supported-compilers.html
I hope this would be helpful to resolve this and similar queries.
Regards,
Shivam.

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by