필터 지우기
필터 지우기

Invalid Mex File: Gateway Function is missing in compiled app

조회 수: 31 (최근 30일)
Aaron Corcoran
Aaron Corcoran 2021년 2월 12일
편집: Namnendra 2023년 4월 27일
I've built an app in appdesigner that uses some C++ code and Mex. I then compiled this app and sent it to some users using Windows 10. It works fine on my computer and at least one of my users is able to get it to work, but another user is getting this error when she tries to run it:
Invalid Mex-file 'C:\Users\username\appData\Local...\BackgroundSubtractorOCV.mexw64' : Gateway function is missing.
I'm using a background subtractor script from openCV provided by Matlab.
None of the answers I've seen around this issue online have helped. Thanks for any help you can provide.
  댓글 수: 1
Einar Heiberg
Einar Heiberg 2021년 7월 14일
I have also recently got the same problem. Works on a lot of machines and then suddenly on one machine it does not work. Tried to upgrade Microsoft Visual Studio libraries on that machine, but it did not help.

댓글을 달려면 로그인하십시오.

답변 (1개)

Namnendra
Namnendra 2023년 4월 27일
편집: Namnendra 2023년 4월 27일
Hey Aaron,
This error message typically occurs when the Mex-file is not compiled correctly or is missing the gateway function that is required to communicate between MATLAB and the C++ code. This can happen if the user's computer does not have the required libraries or if the Mex-file was not compiled for their specific architecture.
To resolve this issue, you can try the following steps:
1. Make sure that the user's computer has the required libraries and dependencies for the OpenCV background subtractor script. You can check the MATLAB documentation for the specific requirements.
2. Recompile the Mex-file on the user's computer. To do this, you can use the `mex` function in MATLAB to compile the C++ code into a Mex-file. Make sure to compile the Mex-file using the same architecture as the user's computer (e.g., 64-bit or 32-bit).
3. Check that the gateway function is present in the Mex-file. You can use the `whos` command in MATLAB to check if the gateway function is present in the Mex-file.
4. Make sure that the Mex-file is included in the MATLAB path on the user's computer. You can use the `addpath` function in MATLAB to add the path to the Mex-file to the MATLAB path.
If these steps do not resolve the issue, you may need to check if there are any compatibility issues between the OpenCV version used by the user and the version used to compile the Mex-file.

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by