How can I check the availability of the MATLAB Compiler Runtime (MCR) on a Windows machine from a C program?

2 visualizaciones (últimos 30 días)
I have created a C shared library on windows machine using the MATLAB Compiler. I want to link this library with my program and deploy it to other Windows machines.
How can I check from my driver program whether the required version of the MATLAB Component Runtime is installed on the system?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 7 de Jul. de 2009
You can call the 'LoadLibrary' function from the Windows API and try to load a DLL that is part of the MCR.
The LoadLibrary function can be called with a string argument and it returns a handle/pointer greater than 0 if the library exists. It will return 0 if it failed to find the library.
See the following page more details about the function:
<http://msdn.microsoft.com/en-us/library/ms684175(VS.85).aspx>
You can include the following call to the LoadLibrary function in your C code to test if the MCR is installed:
LoadLibrary("mclmcrrt7x.dll");
where x is the minor version number of the MCR. You can find out the correct MCR version by running the MCRVERSION command in the MATLAB command window (in the same version of MATLAB in which you compiled your MATLAB code). The minor version number is the second return value of the MCRVERSION function; i.e. 'b' in the following MATLAB command-line:
[a b]=mcrversion

Más respuestas (0)

Categorías

Más información sobre C Shared Library Integration en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by