Question

I am trying to see if you can distribute a MEX file without requiring the end user to install the C++ runtime libraries. When you use visual 2010 express to create MEXs, Matlab issues this warning :


Warning: Applications/components generated using Microsoft Visual C++
2010 require that the Microsoft Visual Studio 2010 run-time
libraries be available on the computer used for deployment.
To redistribute your applications/components, be sure that the
deployment machine has these run-time libraries.


Is there a compiler that doesn't require to install the run-time libraries on the end machine?

Was it helpful?

Solution

Yes there is: MinGW(-w64) GCC. It only links to the OS library msvcrt.dll (when you link with the -static option), which requires no installation and is part of Windows.

To get Matlab to work with that, you'll need to jump through some hoops. Here is some information. Ignore the Cygwin stuff, and be sure to use a MinGW-w64 toolchain targetting x64 Windows from the link above. Note I haven't personally tested this, but this is your best bet. It's also unsupported by Mathworks, so you are on your own.

As an aside, what's the problem with installing the MSVC++2010 redistributable anyways? There's no effect on licensing, and running MEX code implies having Matlab installed. Installing one more little thing won't be that much trouble IMHO.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top