Mixing loadlibrary and mex using same DLL

6 ビュー (過去 30 日間)
John Kuehne
John Kuehne 2012 年 7 月 10 日
Can I load a library and use Matlab's calllib machinery, and also use mex files that call on the same DLL? Will they interfere with each other?

回答 (1 件)

Philip Borghesani
Philip Borghesani 2012 年 7 月 11 日
There is no interference other then that clearing/unloading the library requires clearing the mex file and unloading the library. The operating system maintains a count of how many times a library is loaded and will not unload it until it is no longer in use.
It is also possible to add mex like functionality to a custom library you will load with loadlibrary. Take a look at extern\examples\shrlib\yprime.c which is a modified copy of the mex yprime example that can be called as a mex file and can be loaded with loadlibrary and has functions that use the mx api.

カテゴリ

Help Center および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by