Unhandled exception thrown when run connectMATLAB()
4 次查看(过去 30 天)
显示 更早的评论
hi, I am currently building my c++ program running with Simulink. I have tried the code I found from the website: https://uk.mathworks.com/help/matlab/matlab_external/run-simulink-simulation-from-c.html
However, it seems I've some problem when I run this code :
std::unique_ptr<MATLABEngine> matlabPrt = connectMATLAB(session);
When I run connectMATLAB() it gives me unhandled exceptions:
Exception thrown at 0x00007FFE495EA388 in ConsoleApplication1.exe: Microsoft C++ exception: std::runtime_error at memory location 0x00000098BA8FD678.
Exception thrown at 0x00007FFE495EA388 in ConsoleApplication1.exe: Microsoft C++ exception: mwboost::exception_detail::clone_impl<fl::filesystem::PathNotFound> at memory location 0x00000098BADFE670.
Exception thrown at 0x00007FFE495EA388 in ConsoleApplication1.exe: Microsoft C++ exception: mwboost::exception_detail::clone_impl<fl::filesystem::PathNotFound> at memory location 0x00000098BADFE930.
Exception thrown at 0x00007FFE495EA388 in ConsoleApplication1.exe: Microsoft C++ exception: foundation::core::except::Exception<MATLAB::engineAPI::SharedMatlabNotFound,std::exception,void> at memory location 0x00000098BADFF4D8.
Exception thrown at 0x00007FFE495EA388 in ConsoleApplication1.exe: Microsoft C++ exception: foundation::core::except::Exception<MATLAB::engineAPI::SharedMatlabNotFound,std::exception,void> at memory location 0x00000098BACFCFD0.
Exception thrown at 0x00007FFE495EA388 in ConsoleApplication1.exe: Microsoft C++ exception: matlab::engine::EngineException at memory location 0x00000098BACFD4D0.
Exception thrown at 0x00007FFE495EA388 in ConsoleApplication1.exe: Microsoft C++ exception: matlab::engine::EngineException at memory location 0x00000098BA8FEBF0.
Unhandled exception at 0x00007FFE495EA388 in ConsoleApplication1.exe: Microsoft C++ exception: matlab::engine::EngineException at memory location 0x00000098BA8FEBF0.
ID Managed ID Category Name Location
14072 0 Main Thread Main Thread msvcp140d.dll!__ExceptionPtr::_RethrowException
4436 0 Worker Thread ntdll.dll!TppWorkerThread ntdll.dll!NtWaitForWorkViaWorkerFactory
12540 0 Worker Thread ntdll.dll!TppWorkerThread ntdll.dll!NtWaitForWorkViaWorkerFactory
5392 0 Worker Thread ntdll.dll!TppWorkerThread ntdll.dll!NtWaitForWorkViaWorkerFactory
15404 0 Worker Thread ntdll.dll!TppWorkerThread ntdll.dll!NtWaitForAlertByThreadId
4120 0 Worker Thread ntdll.dll!TppWorkerThread ntdll.dll!LdrpCompareModuleBaseAddresses
It navigates me to the row 579 in the excptptr.cpp file.
I have no idea, what happen.
3 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call MATLAB from C++ 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!