Why my C++ shared library DLL created using MATLAB Compiler crashes with a Fatal Java Exception?

7 ビュー (過去 30 日間)
I have a C++ shared library DLL generated using MATLAB Compiler, and I am running code from C++ that is using this compiled shared library DLL. When I initialize my DLL I get the following MATLAB crash message:
Assertion in void __cdecl `anonymous-namespace'::mwJavaAbort(void) at b:\matlab\src\jmi\javainit.cpp line 1356:
Fatal Java Exception. See Java Crash Report for details.

採用された回答

MathWorks Support Team
MathWorks Support Team 2022 年 11 月 28 日
This issue can potentially be caused by the DLL not being able to locate the correct MATLAB Runtime Libraries.
Applications generated with MATLAB Compiler or MATLAB Compiler SDK use the system library Path to locate the MATLAB Runtime libraries. This issue can potentially be resolved by editing the System Path Environment Variable.
 
  1. Run "C:\Windows\System32\SystemPropertiesAdvanced.exe" and click the "Environment Variables..." button.
  2. Select the system variable "Path" and click "Edit...".
    • If you do not have administrator rights on the machine, select the user variable "Path" instead of the system variable.
  3. Click "New" and add the folder <MATLAB_RUNTIME_INSTALL_DIR>\runtime\<arch>.
    • For example, if you are using MATLAB Runtime R2022a located in the default installation folder on 64-bit Windows, add C:\Program Files\MATLAB\MATLAB Runtime\v912\runtime\win64.
  4. Click "OK" to apply the change.
  5. Make sure the first Runtime path that appears on the System Path list is the correct version
If you have multiple versions of MATLAB Runtime installed, make sure that the first MATLAB Runtime Path that appears on the System Path list is the correct version.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler SDK についてさらに検索

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by