How can I check the availability of the MATLAB Compiler Runtime (MCR) on a Windows machine from a C program?
2 views (last 30 days)
Show older comments
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?
Accepted Answer
MathWorks Support Team
on 7 Jul 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 Comments
More Answers (0)
See Also
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!