loading functions defined in header file with loadlibrary()

2 ビュー (過去 30 日間)
Kaleb Barrett
Kaleb Barrett 2016 年 8 月 19 日
コメント済み: Kaleb Barrett 2016 年 8 月 21 日
Background: Where I work, we use data acquisition units that record data in the manufacturer's proprietary format. However, we mainly use MATLAB for analyzing the data. In the past we would have to use the manufacturer's software to export the data into another format (usually CSV) before being able to import it into MATLAB. This is incredibly slow. Recently, I learned the manufacturer provides a closed-source library for dealing with the data files. I'd like to be able to use this library with MATLAB so the data can be directly imported into MATLAB for analysis.
Question: When I use loadlibrary() on the dll and header file I get errors about missing functions. These missing functions are defined in the header file and I'm guessing that MATLAB does not import functions defined in headers. Is this the case? And if it is, what is the best way to get around it?
  4 件のコメント
James Tursa
James Tursa 2016 年 8 月 19 日
編集済み: James Tursa 2016 年 8 月 19 日
Are you sure that specific header file goes with the specific library file you are using? Looks like a mismatch.
Kaleb Barrett
Kaleb Barrett 2016 年 8 月 21 日
Yes, I'm absolutely sure. The basic architecture of the library is that library functionality is only made available through function pointers that loadFunction and friends initialize. There is another header file with typedefs to cast the raw function pointers so you can call the loaded library functions. It's a common late binding technique, although probably unnecessary in this case.
Unless MATLAB has some hidden functionality to import functions defined in header files I'm thinking the easiest way this is going to be worked around is by writing a wrapper library that exposes the library functions as they are, without the late loading.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by