C++ Interface workarounds for limitations

11 visualizzazioni (ultimi 30 giorni)
How can I work around some of the limitations for the C++ Interface?

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 11 Apr 2022
Modificato: MathWorks Support Team il 11 Apr 2022
Below is a list of some of the C++ Interface limitations. In some cases a workaround is provided.
Creating objects of classes in the std namespace 
  • Workaround:  example with std::stack
  • std::wstring and other std::string variants
    • Support starting in: R2020b
  • std::complex  
    • Support starting in: R2022a
  • std::vector as a class data member
    • Support starting in: R2022a
Class templates with incomplete or no instantiations
Arrays and vectors of class objects
  • Support starting in: R2020a
void*
  • Support starting in: R2021a
Function pointer
  • Support starting in: R2021a
Preprocessor directives
Array of std::string
  • Workaround: string arrays
  • void foo(std::string[] s)
  • std::vector<std::string>
    • Support starting in: R2021a
Data member
  • Array/Pointer data members
    • Support starting in: R2020a
  • Reference data members
More detail is supplied in the Workaround links, but these general steps apply:
To run the workaround examples on Windows®:
  • Download or copy the C++ header file statements into .hpp files.
  • Download or copy the source code into .cpp files and build, using instructions in How to build a  shared library file for the C++ Interface on Windows .
  • Execute the MATLAB code to build the interface.
  • If required, edit the library definition file.
  • Execute the MATLAB code to test the functionality.

Più risposte (0)

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by