Why do I get a, Invalid MEX-file error .

I'm trying to run a mex file compiled in VS2010, but when I call it from Matlab the prompt return the next error message.
Invalid MEX-file 'C:..\MyFunction.mexw32': The specified procedure could not be found.
Why?

4 件のコメント

stefano davoli
stefano davoli 2017 年 4 月 21 日
Same problem. Any sol found?
James Tursa
James Tursa 2017 年 4 月 21 日
@Stefano: What are your specific circumstances? (Compiler, MATLAB versions, how did you do the compile, etc.)
Image Analyst
Image Analyst 2017 年 4 月 21 日
I don't believe the new 64 bit MATLAB versions can run 32 bit DLLs. At least I couldn't call one of mine when I tried. How many bits is your OS and MATLAB?
Walter Roberson
Walter Roberson 2017 年 4 月 21 日
In MS Windows (and OS-X, and Linux) 64 bit executables cannot call 32 bit libraries. This is a limitation of the operating system architecture.
(I have never encountered an operating system that allowed this, but I could not say for sure that no operating system allows it.)

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

回答 (2 件)

Image Analyst
Image Analyst 2012 年 12 月 10 日

1 投票

How are you trying to run the mex file? As I understand it you don't run these, you call them from an m-file since they are basically DLLs. What happens if you say
>> which -all MyFunction
on the command line? Are you sure it's on your search path? If you say "path" does the folder where the mex file lives appear on the path?

1 件のコメント

Walter Roberson
Walter Roberson 2012 年 12 月 10 日
Also, are you trying to run it from a 32 bit MATLAB or a 64 bit MATLAB ? .mexw32 is only for 32 bit MATLAB.

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

Ken Atwell
Ken Atwell 2012 年 12 月 10 日

0 投票

Could your MEX-File require another .DLL, and it is that DLL that cannot be found? Use a tool like Dependency Walker to display the functions available inside the MEX-File ("mexFunction" at a minimum should be there), and anything it may depend on. Anything in red may not be visible to MATLAB.

カテゴリ

ヘルプ センター および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

タグ

質問済み:

2012 年 12 月 10 日

コメント済み:

2017 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by