Unhandled exception thrown when run connectMATLAB()

5 visualizzazioni (ultimi 30 giorni)
hao ding
hao ding il 19 Nov 2018
Spostato: Rik il 4 Lug 2023
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 Commenti
fee
fee il 25 Lug 2019
Spostato: Rik il 4 Lug 2023
I have the same Problem. Did you find a solution?
Stéphanie Monteiro
Stéphanie Monteiro il 7 Giu 2021
Spostato: Rik il 4 Lug 2023
I have the same problem, did you find a solution?

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by