Are 32-bit MEX-files supported for 64-bit MATLAB running on Windows XP x64?

조회 수: 16 (최근 30일)
I would like to call my MEX-function myfunc.mexw32 that I compiled on a 32-bit version of MATLAB 7.2(R2006a) from a 64-bit Windows machine running 64-bit MATLAB 7.2 (R2006a). However, when I issue the following at the MATLAB command prompt:
myfunc
I receive the following error:
??? Undefined function or variable 'myfunc'.
I have verified that myfunc.mexw32 is in my current work directory. I would like to know how to successfully call this function from my 64-bit Windows machine.

채택된 답변

Murugavel Sivagnanam
Murugavel Sivagnanam 2011년 1월 11일
It is not possible to run a 32-bit MEX-file from within a 64-bit version of MATLAB. This is because MEX-files are shared libraries and it is not possible to call a 32-bit shared library from a 64-bit application (or vice versa).
To work around this issue, you will need to start the 32-bit version of MATLAB. Please note that this mode is not fully supported, but should work in most cases. You will need to have the 32-bit version of MATLAB installed for this to work. If you do have the 32-bit MATLAB installed on your 64-bit machine, you can launch the 32-bit version of MATLAB, and then call the MEX file from the command prompt.
Alternatively, if you have the source code for the MEX file, you can compile it into a 64-bit MEX file from the 64-bit version of MATLAB. To do so, you need to have a supported 64-bit compiler installed on your machine. Please refer to the following link to identify the compilers supported by the MEX interface of MATLAB R2006a on 64-bit Windows machines:
http://www.mathworks.com/support/compilers/1601_72.html#PC64

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by