Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: C++ MEX/DLL in Matlab 5
Posted:
May 16, 1997 3:25 PM


In article <5lenlv$i5g$1@trog.dra.hmg.gb>, sawatts@dra.hmg.gb says... > Has anybody had any luck in joy in compiling a C++ MEX/DLL for Matlab 5 > (WinNT 4)? >
Yes. Can you describe what type of trouble you ran into? I've created S Function mexfiles, but a regular MEX DLL is pretty much the same.
It was actually easier to get this working with Visual 5 since it defines the BOOL datatype. The mex.h include file is already setup to deal with C++ compilers, so wrapping mex.h in extern "C" isn't necessary.
You will need to define MATLAB_MEX_FILE, include matlab.lib in the project, and use a .def file unless the mexFunction is explicitly exported.
Feel free to contact me directly if you have questions.
Gary
 Gary Levenson The MathWorks, Inc. www.mathworks.com



