whats the difference between a mex file and a dll

Whats the difference between a mex file and a dll? How does the different versions of Matlab treat them?

 채택된 답변

Jan
Jan 2011년 10월 5일

2 개 추천

Compiled MEX files are DLLs with a special entry function "mexFunction" as gateway to MATLAB. DLLs without this gateway need the CALLLIB command to be run.
In older Matlab versions, MEX-DLLs used the file extension .dll, but today there are different extension to avoid confusion between the different systems, e.g. .mexw32 and .mexw64 for the 32 and 64 bit Windows versions.
Old Matlab versions cannot run MEX files compiled for modern versions. Old DLL files compiled with Matlab 6.5 can be executed by modern Matlab 32 bit versions, but the support will be (or is already?) stopped. Then a recompilation of the C/C++/Fortran-sources is required. MEX files compiled with 32 bit systems can be run in 32 bit systems only, the same for 64 bits.
If you have a specific question, answering would be easier.

댓글 수: 2

DLLs that are not MEX files are often referred to as generic DLLs.
Jan
Jan 2011년 10월 5일
And sometimes the C, C++ or Fortran source code files are called MEX files also, if they can be compiled by the "mex" command to mex files. Therefore a distinct level of confusion is healthy.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

태그

질문:

2011년 10월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by