importing c++ header with "importExternalCTypes" results in "dot indexing is not supported"

11 ビュー (過去 30 日間)
Patrick
Patrick 2025 年 7 月 24 日
回答済み: Harsh 2025 年 8 月 19 日 5:44
I have a simple c++ header that looks something like the following, and it errors out when running "importExternalCTypes" with "dot indexing is not supported ..."
is there a trick to importing c++ enum classes with namespaces?
namespace Outside {
namespace Inside {
enum class MyEnum {
One, Two, Three
};
}
}

回答 (1 件)

Harsh
Harsh 2025 年 8 月 19 日 5:44
While importing C++ enum classes using importExternalCTypes, I encountered a similar error.
One workaround I tried was converting the '.hpp' files to C-style '.h' files. After this, I used the Simulink.importExternalCTypes command.
Alternatively, you can try upgrading to MATLAB R2025a, as this issue is completely resolved, even when using '.hpp' files.
I hope this helps!

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by