call dlls in for compiled application

Hi all
i built a app with app designer. I get an error "No class lib..\dev\bin\64-bit\nilibddc.dll." after install the app
One of the function i need to call the dll provided by NI http://www.ni.com/product-documentation/3727/en/#toc4.
Relative path is used in the function ".\dev\bin\64-bit\nilibddc.dll'"
I package the app and install in another PC. The GUI can not find the dll path and load the dlls.
Is something wrone here do define the dll path.
Or i do not coeectly take care of nilibddc_thunk_pcwin64.dll file?
Thanks a lot
libname = 'nilibddc';
NI_TDM_DLL_Path = '.\dev\bin\64-bit\nilibddc.dll';
NI_TDM_H_Path = '.\dev\include\64-bit\nilibddc_m.h';
if ~libisloaded(NI_TDM_DLL_Path)
% loadlibrary(NI_TDM_DLL_Path,NI_TDM_H_Path);
loadlibrary(NI_TDM_DLL_Path, @mylibraryfile);
libfunctions(NI_TDM_DLL_Path,'-full');
end

 Réponse acceptée

Robin
Robin le 6 Nov 2019

1 vote

I have fixed the issue
2) Do not use relative path here for the function to call dlls. This is a mistake i made
filepath = fileparts(mfilename('fullpath'));
NI_TDM_DLL_Path = [filepath,'\dev\bin\64-bit\nilibddc.dll'];
3) package the app, update "Shared resources and helper files" to add the dll folder prototype m–file & library_thunk_pcwin64.dll into the app.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by