Error when running Matlab executable on a PC with two Compiler Runtime versions

I have a pc that runs an application calling a Matlab dll using 'Matlab Compiler Runtime 8.0' (2012b). Now I need to run a Matlab exe file on the same computer, but this one needs 'Matlab Runtime 9.0.1' (2016a). So I installed this runtime and tried to the run the execuatble. Now I get the following error:
Undefined function or variable 'imfilter_mex'
Now, when deinstall both runtimes, restart the PC and then only install 'Matlab Runtime 9.0.1', the executable could be run without any problems. When I subsequently install 'Matlab Compiler Runtime 8.0' again, running the executable fails again. Most surprisingly, when repeat the cycle of deinstalling both runtimes and installing only 'Matlab Runtime 9.0.1' again, I keep on getting the error message whatever I am doing.
Could you please help me tackle this issue? Thanks in advance!

4 commentaires

Ideally, the application should be able to find the correct version of MCR from your system. If not, you might want to go to the Environment variables followed by changing the Path (System variable) and make sure that the required Runtime version is on the top. As an example, while running the application (that requires 9.1), “Move Up” the following path: C:\Program Files\MATLAB\MATLAB Runtime\v91\runtime\win64 (this may be different for your system).
Also, could you send a sample code to help us reproduce this issue on our end?
Thank you for your reply!
However, I do not understand the answer. How do I go to the environment variables? And on which machine, the source machine with Matlab installed or the target machine without Matlab installed? Then, how to change the path?
Maybe it will help: when generating the exe file, a text file mccExcludedFiles.log is created which tells that the folowing is excluded:
addInstalledToolboxesToPath.m, addInstalledZipAddOnsToPath.m, pathdef.m and initdesktoputils.m. (See also attached text file.) Could this be the cause of the problem?
Further, I have included sample code where the function imfilter is called.
How do I go to the environment variables? And on which machine, the source machine with Matlab installed or the target machine without Matlab installed? Then, how to change the path?
1) google - how to get environment variables in window. after that, click on path, change the path here. There is some video explaining it in better way.
2) MCR should be installed in the target machine without MATLAB installed.
Thanks, I already discovered how to change the path and that this is about target PC. Indeed, the path had a reference to an old MCR which I removed. However, this did not solve the problem.
I managed to solve the issue by merely re-deployment of the executable and replacing the old one on the target PC with this new one. Code has not be changed. So I do not understand why this helped.
But anyway, my problem is gone. Thanks for your contributions!

Connectez-vous pour commenter.

Réponses (0)

Catégories

Produits

Version

R2016a

Question posée :

le 9 Oct 2018

Commenté :

le 26 Oct 2018

Community Treasure Hunt

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

Start Hunting!

Translated by