How do I resolve a MATLAB crash when using C++ Interface library?

8 次查看(过去 30 天)
When I call my custom C++ library using MATLAB C++ Interface, MATLAB crashes. How can resolve this issue?

采纳的回答

MathWorks Support Team
编辑:MathWorks Support Team 2023-3-21
A MATLAB crash while using a custom C++ library could be caused by a number of issues, including an issue with the custom library (for example, coding error) or a version conflict between the custom library, or its dependencies, and third-party C++ libraries that are shipped with MATLAB.
For both of these types of causes, it might be beneficial to use out-of-process execution mode (available in R2023a, and later releases).
If a library conflict is the cause of the crash, working in out-of-process execution mode may resolve the issue, since out-of-process execution mode has fewer dependencies on third-party libraries. Also, if the library conflict is not resolved by using out-of-process execution mode, the process will simply terminate and MATLAB will not crash.
Similarly, if the crash is due to a coding issue, then debugging and testing the code will be easier in out-of-process execution mode, since errors will simply cause the process to terminate and MATLAB will not crash. In addition, after making code changes, the library can be unloaded and reloaded without having to restart MATLAB.
 

更多回答(0 个)

类别

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