Unhandled exception thrown when run connectMATLAB()

8 visualizaciones (últimos 30 días)
hao ding
hao ding el 19 de Nov. de 2018
Movida: Rik el 4 de Jul. de 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 comentarios
fee
fee el 25 de Jul. de 2019
Movida: Rik el 4 de Jul. de 2023
I have the same Problem. Did you find a solution?
Stéphanie Monteiro
Stéphanie Monteiro el 7 de Jun. de 2021
Movida: Rik el 4 de Jul. de 2023
I have the same problem, did you find a solution?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Call MATLAB from C++ en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by