C++ Interface workarounds for limitations

10 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2021 年 9 月 28 日
編集済み: MathWorks Support Team 2022 年 4 月 11 日
How can I work around some of the limitations for the C++ Interface?

採用された回答

MathWorks Support Team
MathWorks Support Team 2022 年 4 月 11 日
編集済み: 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 Center および File ExchangeCall C++ from MATLAB についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by