C engine: rebuild required when MATLAB upgraded?

1 次查看(过去 30 天)
We have a C++ application that calls engopen() and other MATLAB C-engine routines. Do we have to rebuild it every time we upgrade the version of MATLAB that is installed on the computer or can we just change the runtime environment: update the PATH order and execute matlab /regserver as described in other topics?

采纳的回答

James Tursa
James Tursa 2011-2-9
One problem with Engine applications is that they will start the MATLAB version that most recently executed a matlab/regserver, which is not necessarily the version they were compiled with. So if you have app1 compiled with MATLAB version "A" and app2 compiled under MATLAB version "B", they will both attempt to start the Engine using the same version of MATLAB (even if both "A" and "B" versions are installed), and of course one of them may fail. It's a pain, but the only way I have gotten it to work is to either recompile or to re-execute a matlab/regserver for the specific required version of MATLAB prior to starting the app.
  2 个评论
John
John 2011-2-9
Thank you. So, if we want an app to work with 'any' version of MATLAB, we need to rebuild the app linking in the MATLAB lib files for each version of MATLAB as it becomes available. Correct? Or, perhaps it would be maintained more easily if the engine calls were all collected in a DLL built for each MATLAB version. Does that seem reasonable?
James Tursa
James Tursa 2011-2-10
I don't know if it is possible to have a single app work with several versions of MATLAB. Seems to me you would have name clashes in the linking. But this is beyond my experience as I have never tried it. I think you are stuck with rebuilding the app for each version and then either always use the latest version *or* have a bat file that executes a matlab/regserver for a specific version of MATLAB (it doesn't have to be the latest version) prior to starting up the app.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call MATLAB from C 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by