How can I check the availability of the MATLAB Compiler Runtime (MCR) on a Windows machine from a C program?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?
Réponse acceptée
MathWorks Support Team
le 7 Juil 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
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur C Shared Library Integration dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!