"error Using MATLAB Data API with C Matrix API is not supported."
13 ビュー (過去 30 日間)
古いコメントを表示
I wish to use ArrayFactory, but when I include "MatlabDataArray.hpp" in my main cpp I get this error when I do an mbuild using the .so and main cpp.
Under the Library Compiler App, I am compiling a C++ shared library. Under the "API Selection" option | "C++ Shared Library API", regardless of whether I select "Create interfaces that use mwArray API and MATLAB Data API" or ""Create interfaces that use mwArray API", I get this error.
I cannot find mention of this particular error anywhere.
Thanks for any help.
Mark A.
0 件のコメント
採用された回答
Manoj Mirge
2023 年 5 月 16 日
This error occurs when you try to compile C++ shared library which uses functions from MATLAB Data API and MATLAB C API.It might be possible that you are mixing the functions from MATLAB Data API with functions from MATLAB C API in your library.
The MATLAB Data API supports C++11 features and is not compatible with the C Matrix API or MATLAB C API. You cannot mix functions from the MATLAB Data API with those in the C Matrix API or C MEX API. Likewise, you cannot mix MATLAB Data API functions with functions in the MATLAB Engine API for C or MATLAB C API to Read MAT-File Data in a standalone application.
As a workaround you can migrate all your library code to use only MATLAB Data API. MATLAB Data API uses modern C++ semantics (C++11). This has several advantages over the “mwArray” API, including type-safety, multithread-safety, and copy-on-write semantics.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で C Shared Library Integration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!