Invalid MEX-file: The specified module could not be found.

9 views (last 30 days)
Update: I copied the .dll file to the same directory as the mexw64 file, and the script seems to run fine. However, Matlab crashes everytime after this step (crash log posted in the comment section):
INIT STARTEDSetting debug on
matleap version 4.0
Could anyone please advice me on what can be happening here? Thank you so much!
Hello! I am trying to wrap C++ data into Matlab by making a mex-file. I got the following error when I was testing the mex file that I built:
Invalid MEX-file 'C:\Users\...\OneDrive - ...\PROJECT\Leap Motion\matleap\matleap.mexw64': The specified module could not be found.
Error in matleap_version (line 3)
v=matleap(0);
Error in test_matleap (line 12)
[version]=matleap_version;
I checked and .dll file is added to the path when I run the test. Could anyone please give me some advice on what could be the problem? I saw in some previous questions that I should use dependency walker, but that application is just not responding when I try to open a the mex file in it.
  14 Comments
Bruno Luong
Bruno Luong on 27 Mar 2024
Edited: Bruno Luong on 27 Mar 2024
The purspose of -R2018a switch is to cope with change of internal storage: interleaved complex number storage and accesory using some mxGetxxxx API, This major change of internal happens in R2018a. however your mex compile without the flag, so those API are not used.
There is not such switch as -R2023b.
You should add -R2018a switch if you use direct mex command. But I believe the effect would be only accelerate the code execution, since no data copying (hidden to user) if mxGetData, mxGetPr, mxGetPi is performed in theory.
Julia
Julia on 9 Apr 2024
Solution found! The problem was not with the code. It seems like my recording device was not activated when I was running the script. Matlab probably was crashing because it cannot find the frames it was supposed to get. Huge thanks to James and Bruno for your help!

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!