Error using calllib Too many inputs passed to SimpleFunctionThunk.
5 views (last 30 days)
Show older comments
sahil gandhi
on 18 Aug 2015
Answered: sahil gandhi
on 30 Jan 2018
I am using the calllib function to call on my 64-bit C++ lib. I am using Matlab R2015a. The prototype used to load the library using the loadlibrary function is
ival={cell(1,1)};
fcns=struct('name',ival,'calltype',ival,'LHS',ival,'RHS',ival,'alias',ival);
structs=[];
enuminfo=[];
fcns.name{1}='MyFunc'; fcns.calltype{1}='cdecl'; fcns.LHS{1}='doublePtr'; fcns.RHS{1}={ ...
'stringPtr' , 'int32Ptr' , 'stringPtr' , ...
'int32Ptr' , 'stringPtr' , 'int32Ptr' , ...
'int32Ptr' , 'doublePtr' , 'int32Ptr'};
methodinfo=fcns;
After the loadlibrary, I have verified that its loaded using the libfunctionsview function. After the call is made, i get the following error
Error using calllib
Too many inputs passed to SimpleFunctionThunk.
Please let me know if there is any fix to this issue.
-Sahil
1 Comment
Accepted Answer
More Answers (1)
Philip Borghesani
on 18 Aug 2015
Calltype of 'cdecl' is not supported on 64 bit systems however it does work for simple functions with a limited number of integer and pointer arguments. You will need to use a thunkfile to call this function. Try loading your file with a new loadlibrary command starting from scratch and examine the generated prototype information and thunk file.
0 Comments
See Also
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!