Gary Levenson wrote: > > In article <email@example.com>, firstname.lastname@example.org 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 mex-files, 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
NOTE: That if you are compiling with a compiler that does not support the BOOL datatype, you can use the preprocessor directive NO_BUILT_IN_SUPPORT_FOR_BOOL. See mex.h for more information.