calling a dll

7 ビュー (過去 30 日間)
Steve
Steve 2011 年 7 月 11 日
I wish to call my dll (simpledll)from Matlab R2007b; I have loaded the dll successfully. Then from the 'libfunctions' I get the function: "doublePtr changevar(double, doublePtr)" displayed. This looks ok to me, as all it does is inputs a value (double) & returns a value (double).
I tried calling it using the following: in1=2; [out1]=callib('simpledll','changevar',in1);
But I get the following error on the calling line: "Undefined function or method 'callib' for input arguments of type 'char'."
What does this mean; have I got the format for calling the dll wrong; what should I have put?

採用された回答

Friedrich
Friedrich 2011 年 7 月 11 日
Hi,
this be because calllib is written with three l instead of two like you did.
  2 件のコメント
Steve
Steve 2011 年 7 月 11 日
Yes you are correct;MatLab did not highlight the typo error. I have corrected this but now get the error message "Error using==> calllib
No method with matching signature". Any ideas what this means?
Kaustubha Govind
Kaustubha Govind 2011 年 7 月 11 日
doublePtr changevar(double, doublePtr)
this seems to indicate that the function needs two inputs, but you are only providing one.

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

その他の回答 (1 件)

Steve
Steve 2011 年 7 月 11 日
Yes you are correct;MatLab did not highlight the typo error. I have corrected this but now get the error message "Error using==> calllib No method with matching signature". Any ideas what this means?
  3 件のコメント
Steve
Steve 2011 年 9 月 27 日
The dll (simpledll)has a function called 'changevar' with one input 'in1' and one output 'out1'. So have I got the MatLab format wrong: [out1]= calllib('simpledll','changevar',in1)?
Kaustubha Govind
Kaustubha Govind 2011 年 9 月 27 日
You said that libfunctions lists the function as "doublePtr changevar(double, doublePtr)" - this indicates that the function has 2 inputs. What is the corresponding signature for the function with one input?

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

カテゴリ

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