C++ Interface workarounds for limitations

6 次查看(过去 30 天)

采纳的回答

MathWorks Support Team
编辑:MathWorks Support Team 2022-4-11
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call C++ from MATLAB 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by