Thursday, August 28, 2008

Cross-compiling matlab mex files from linux for windows

With the help of a properly set up cross-compiler (there is a cross-tool setup script on the SDL site, I believe), it is not really a problem to cross-compile windows mex files from linux.

You will need the matlab headers and "*.lib" files from the "extern/win32/lcc" directory. Armed with these, a working version of WINE, the gnumex utility (http://gnumex.sourceforge.net/), as well as some of the MinGW binutils (nm.exe, as.exe), you can generate the def files for the libs. Then it is a matter of setting the compile flags properly. I did this by using the parts of the gnumex source to generate the .def files.

Dlltool info:
http://www.cygwin.com/cygwin-ug-net/dll.html

No comments: