Certain Fixed Array Length Syntax Not Supported by LOADLIBRARY

11 ビュー (過去 30 日間)
William
William 2012 年 3 月 23 日
The following structure causes an error with the LOADLIBRARY parser using MATLAB version 7.10.0.499 (R2010a):
struct foo { int a, b, c[20]; };
However, this equivalent syntax does work:
struct foo { int a, b; int c[20]; };
  1 件のコメント
Ken Atwell
Ken Atwell 2012 年 3 月 23 日
What platform (Windows, Linux, Mac) and what compiler are you using? Are you running 32-bit or 64-bit MATLAB?

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

採用された回答

Philip Borghesani
Philip Borghesani 2012 年 3 月 23 日
This is a bug in loadlibrary it should soon be on the system as bug report 814593.
For now there are two possible workarounds you can modify the structure definition in your header file or create a loader MATLAB file with the 'mfilename' loadlibrary option and fix the broken field. For your example:
structs.foo.members=struct('a', 'int32', 'b', 'int32', 'error0', ' c [ 20 ]');
Should be:
structs.foo.members=struct('a', 'int32', 'b', 'int32', 'c', 'int32#20');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by