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?

 Risposta accettata

Jan
Jan il 5 Ott 2011
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 Commenti

DLLs that are not MEX files are often referred to as generic DLLs.
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.

Accedi per commentare.

Più risposte (0)

Categorie

Tag

Richiesto:

il 5 Ott 2011

Community Treasure Hunt

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

Start Hunting!

Translated by