Help with reading the functions inside a library

조회 수: 3 (최근 30일)
Jason
Jason 2021년 1월 16일
댓글: Jason 2021년 1월 17일
Is there a reason why the code below cannot find the dll that IS in the directory as shown (there is also the h file with the same name)
[file,path] = uigetfile('C:\Users\Public\PI\PI_Programming_Files_PI_GCS2_DLL\*.dll');
libname=fullfile(path,file)
%Remove the extension
[path,name,ext] = fileparts(libname)
%Rebuild without Ext
libname=fullfile(path,name)
hname=fullfile(path,name) %Dont need this if same name
loadlibrary('libname')
libfunctionsview libname
Error using loadlibrary
Could not find file libname.h.
Error in loadlibrary
(here are the library and header files)

채택된 답변

Rik
Rik 2021년 1월 16일
You first store a filename in a variable, but then you use the Name of the variable to call loadlibrary.
loadlibrary(libname);%this should work better
  댓글 수: 6
Jason
Jason 2021년 1월 17일
Forgive me, but what does 'thunk it' mean

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by