Issue using startMATLAB in C++ with "MatlabEngine.hpp" in r2021b

7 ビュー (過去 30 日間)
ANDREA MONTANARI
ANDREA MONTANARI 2021 年 12 月 30 日
回答済み: Lokesh 2023 年 12 月 13 日
Hello everyone,
i'm trying to use the MATLAB engine to call function from c++.
I've setted up Visual studio with addidtional include an link path and everything compile.
When it start it crash on this instruction:
std::unique_ptr<MATLABEngine> matlabPtr = startMATLAB();
more specifically in that
cpp_engine_create_session()
with access violation on 0x0 address.
My program is x64, i have added to the enviromnet windows path the path of dlls.
I notice that i'm not the only with this problem (Question here), but ther's still no aswer.

回答 (1 件)

Lokesh
Lokesh 2023 年 12 月 13 日
Hi Andrea,
As per my understanding, you are encountering issues using “startMATLAB” in C++ with "MatlabEngine.hpp" in r2021b.
Please refer to the following workaround that might be helpful to resolve the issue:
  • After setting include and library folders, do not copy any “dll” files to your own build folder.
Refer to the community discussion on the following MATLAB answer for further insights and potential solutions:
I hope this resolves your query.

カテゴリ

Help Center および File ExchangeExternal Language Interfaces についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by