error in using calllib function
이전 댓글 표시
i want to use callib function but it shows me an error?
>> loadlibrary('t1.dll', 't1header.h')
>> calllib('t1','Add',2,3)
??? Error using ==> calllib
Method was not found.
i have Add fuction but when i use libfunctionsview it shows me an error :
>> libfunctionsview('t1')
??? Error using ==> libfunctionsview at 47
No library t1 can be located or no functions for library t1
Any suggestions on what is wrong?
댓글 수: 4
Image Analyst
2012년 8월 17일
It thinks you don't have an add method. Post the contents of the h file.
Kaustubha Govind
2012년 8월 17일
Either that or MATLAB couldn't load your library. Try:
[notfound, warnings] = loadlibrary('t1', 't1header.h')
Mahnaz
2012년 8월 17일
편집: Walter Roberson
2012년 8월 17일
Walter Roberson
2012년 8월 17일
답변 (1개)
Walter Roberson
2012년 8월 17일
loadlibrary('shrlib', 'hfile') loads the functions defined in header file hfile and found in shared library shrlib into MATLAB. You must select a supported C compiler and Perl must be available.
Notice that the above says "C compiler". Your .h file is written for C++ (which we can tell from the extern "C")
댓글 수: 1
Kaustubha Govind
2012년 8월 17일
Mahnaz: Also, looks like Titus helped a little with on your previous question which looks like the same issue: http://www.mathworks.com/matlabcentral/answers/45337-connecting-matlab-to-c-language-dll
카테고리
도움말 센터 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!