Effacer les filtres
Effacer les filtres

"error Using MATLAB Data API with C Matrix API is not supported."

20 vues (au cours des 30 derniers jours)
Mark Almquist
Mark Almquist le 30 Avr 2023
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.

Réponse acceptée

Manoj Mirge
Manoj Mirge le 16 Mai 2023
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.

Plus de réponses (0)

Catégories

En savoir plus sur Deploy to C++ Applications Using mwArray API (C++03) dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by