engOpenSingleUse() crash on second call

조회 수: 2 (최근 30일)
Jon
Jon 2015년 10월 5일
답변: Rohit Kudva 2015년 10월 20일
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.

답변 (1개)

Rohit Kudva
Rohit Kudva 2015년 10월 20일
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

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by