一致するシグネチャが存在しないエラー
このエラーは、正しい入力引数または出力引数を使用せずに関数を呼び出した場合や、ヘッダー ファイルの関数シグネチャにエラーがある場合に発生します。
たとえば、shrlibsample
内の関数 addStructByRef
の関数シグネチャは次のとおりです。
[double, c_structPtr] addStructByRef(c_structPtr)
ライブラリを読み込みます。
addpath(fullfile(matlabroot,'extern','examples','shrlib')) loadlibrary('shrlibsample')
構造体を作成し、addStructByRef
を呼び出します。
struct.p1 = 4; struct.p2 = 7.3; struct.p3 = -290;
入力引数を使用せずにこの関数を呼び出した場合、MATLAB® はエラー メッセージを表示します。
[res,st] = calllib('shrlibsample','addStructByRef')
Error using calllib No method with matching signature.
正しい呼び出しは次のとおりです。
[res,st] = calllib('shrlibsample','addStructByRef',struct)