Import Custom C++ Class using Simulink Code Import Wizard

5 ビュー (過去 30 日間)
Chris
Chris 2025 年 4 月 9 日
編集済み: Hitesh 2025 年 4 月 11 日
I am following the Import Custom c++ class using simulink code import wizard page (Import Custom C++ Class Using the Simulink Code Importer Wizard). I defined both the .cpp and header files from the example page. Everything woks fine until I get to the Analyze section. I click next, then the Diagnostic Viewer pops up with the message "Dot indexing is not supported for variables of this type." I copied and pasted both the header file and the .cpp file from the example, and followed the instructions within the example.
Does anybody know why I'm getting the dot indexing error or how to resolve it? In the near future I'm going to need to import a not so simple class and use the methods defined within.

回答 (1 件)

Hitesh
Hitesh 2025 年 4 月 11 日
編集済み: Hitesh 2025 年 4 月 11 日
Hi Chris,
I did not encountered any issue while importing Custom C++ Class using Simulink Code Import Wizard in MATLAB R2024b. However I am assuming that the source file and the header file are adder_cpp.cpp and adder_cpp.h, respectively taken from example. Could you share more information about what you have filled in "Specify "Custom Code" step.
  2 件のコメント
Chris
Chris 2025 年 4 月 11 日
Language: C++
Interface headers: adder_cpp.h (copy paste of header file)
Source files: .\C++\demo\src\adder_cpp.cpp (copy paste of the source file)
Include directories: .\C++\demo\include
Libraries: empty
Defines: empty
Compiler flags: empty
Linker flags: empty
Hitesh
Hitesh 2025 年 4 月 11 日
編集済み: Hitesh 2025 年 4 月 11 日
Hi Chris,
Could you generate all the necessary files within the same directory, add that path to MATLAB and fill the entries in the same way as in the attached image.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeBuild MATLAB Interface to C++ Library についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by