engOpenSingleUse() crash on second call
2 views (last 30 days)
Show older comments
I am using matlab 2015a and calling engOpenSingleUse() from Visual Studio 2010.
I can successfully start and use the engine, but if I try to open the engine for a second time it causes the debugger to crash. Crash might be the wrong word - it ends my c++ program (running in debug mode) without even throwing an exception.
I can replicate this just by running the following:
matlabEngine = engOpenSingleUse(NULL,NULL,&retstatus);
engClose(matlabEngine);
matlabEngine = engOpenSingleUse(NULL,NULL,&retstatus); //program crashes here
Am I doing something wrong? The call to engClose() returns 0 as expected.
0 Comments
Answers (1)
Rohit Kudva
on 20 Oct 2015
Hi Jon,
I understand that when you used 'engOpenSingleUse' function the second time after closing the previous instance of MATLAB engine, your application exited without any exception. I was not able to reproduce this issue on my end but I found link on MATLAB Answers on how to Compile Engine application for Microsoft Visual Studio 2010
I hope the steps provided in the link above resolves the issue.
Regards,
Rohit
0 Comments
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!