C engine: rebuild required when MATLAB upgraded?
1 view (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
James Tursa
on 9 Feb 2011
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 Comments
James Tursa
on 10 Feb 2011
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.
More Answers (0)
See Also
Categories
Find more on Call MATLAB from C 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!