How do I deal with dll dependencies?

조회 수: 10 (최근 30일)
Noah Huffman
Noah Huffman 2017년 7월 24일
댓글: Noah Huffman 2017년 7월 27일
I have a .dll library that is dependent on another (still not entirely sure what that means). The first library has a corresponding .h file, but the library which it depends on does not. How do I write code with loadlibrary that will load this library and factor in the dependencies?

답변 (1개)

Sangeetha Jayaprakash
Sangeetha Jayaprakash 2017년 7월 26일
When a DLL is dependent no another - it means that one DLL relies another one - it might be using the functions from another DLL.
I assume that you have a library, mylib, with the header file, mylib.h. The header file contains the statement, #include header2.h.
In order to use functions defined in header2.h, call loadlibrary with the addheader option as shown below:
loadlibrary('mylib','mylib.h','addheader','header2')
To find library dependencies, you can use Dependency Walker tool. 'Dependency Walker' is a third-party tool that allows you to view the dependencies of your DLL file. This tool is available at the following website:
To view the dependencies of your module, open up your module in Dependency Walker.
Select View->Full Paths to view the complete pathnames of the dependent files.
  댓글 수: 1
Noah Huffman
Noah Huffman 2017년 7월 27일
The Library "Mylib2" in the above context does not have a header file, "header2" that I can find.

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

카테고리

Help CenterFile Exchange에서 Scripts에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by