How can I check the availability of the MATLAB Compiler Runtime (MCR) on a Windows machine from a C program?
2 次查看(过去 30 天)
显示 更早的评论
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?
采纳的回答
MathWorks Support Team
2009-7-7
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 C Shared Library Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!