Shared Library (dll) called by another Shared Library (dll)

조회 수: 1 (최근 30일)
Benjamin Schwabe
Benjamin Schwabe 2012년 2월 7일
편집: Matt J 2013년 10월 12일
Hi all,
I'm dealing with a two-level-driver of some hardware which I'd like to control from MatLab. There are two dll files involved: Level1.dll seems to provide an API towards MatLab, Level2.dll seems to be linked dynaimcally ino Level1.dll.
I am capable of getting the information/ perform actions which require Level1.dll only. However, Level2.dll does not seem to be linked to...
Can MatLab deal with this? Where is my problem?
Thanks for your reply, Benjamin

채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 2월 8일
Do you mean that you are using LOADLIBRARY and are seeing errors loading Level1.dll? Or do you mean that MATLAB loads Level1.dll, but you are unable to call into methods that require Level2.dll? If yes, what errors do you see.
Place Level2.dll also in the same directory as Level1.dll - see if you can run LOADLIBRARY from the directory containing both DLLs. Does this fix the issue?
  댓글 수: 2
Benjamin Schwabe
Benjamin Schwabe 2012년 2월 14일
Thanks for your reply.
I am using LOADLIBRARY and I can access Level1.dll properly. However, Level1.dll returns errors when it wants to use Level2.dll. These errors are specific to Level1.dll and basically they say: "I can't find and load Level2.dll".
Both .dll files are in the same directory and this does not fix the issue.
What helped was loading Level2.dll first with the loadlibrary command and then Level1.dll. However, this results in a very unstable code and I have to restart Matlab with every 2 to 6 th command using the Level2.dll.
Kaustubha Govind
Kaustubha Govind 2012년 2월 14일
Did you try adding the path containing Level2.dll to the system PATH variable (you will need to restart MATLAB after doing this).

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by