I have a .dll library (c++) and I need to Import it to Matlab (I have no header file for it)

조회 수: 6 (최근 30일)
loadlibrary() doesn't work with me because i have no Header file

채택된 답변

Walter Roberson
Walter Roberson 2017년 4월 24일
You will need to write a header file for it listing all the interface routines you wish to be able to call.
Note: it will only be possible to call functions which were created with
extern "C"
in the C++ source.
  댓글 수: 6
Walter Roberson
Walter Roberson 2017년 4월 24일
Looking at the code, it appears to me that it is not designed to be called from C, but
"The loadlibrary function only supports calling functions that are callable from C and header files that can be parsed by a C compiler. Functions written in C++ must be declared as extern "C"."
To call it from MATLAB, you would have to create some interface code that was C compatible.
Omar Abdelkader
Omar Abdelkader 2017년 4월 25일
yes I'm trying to use mdf4reader, I tried to add extern "C" to the 'CMdf4Reader.h' code, I get a warning that there were no functions found!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Use Prebuilt MATLAB Interface to C++ Library에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by