How to run a standalone executable compiled in older version FROM console

I have a standalone executable that was compiled in MCR 9.1 (I do not have the original files)
I need to run that standalone executable from a script in matlab R2018b (MCR 9.5).
I have installed MCR 9.1.
Running the executable on its own works fine. However, when I try to run it from Matlab it complains about not being able to find MCR 9.1
I also tried calling a bat file from Matlab, but it still complains (running the bat file by itself works like a charm).
Any tips?

 採用された回答

Andrew Janke
Andrew Janke 2020 年 1 月 31 日

0 投票

Check the state of the %PATH% environment variable from within Matlab. Matlab adds its own libs to the PATH, and those libs overlap what is in the MCR, so when you're running a compiled-Matlab command via system() from within Matlab 9.5, you're running it against MCR 9.5, even if you have MCR 9.1 installed separately on your computer. You will probably have to make a little batch file that re-adds the MCR 9.1 lib paths to the front of your %PATH% variable, and call your standalone app through that bat file.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

質問済み:

2020 年 1 月 24 日

回答済み:

2020 年 1 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by