how do i load dll files with loadlibrary function?
Afficher commentaires plus anciens
hi guys (and girls :) )... I am working with DSP board from Texas Instruments. I wrote a code on Matlab so I can use this board in my specific way.
I am having an error at the beginning of my code. I need to load the dll files with "loadlibrary" function. the beginning of the code is:
if ~libisloaded('wvdll')
clear all
disp('clear all')
% hfile = fullfile('C:\Users\mojob1\Desktop\dsp\ADC_Project','wvdll.dll');
% loadlibrary('wvdll',hfile)
[notfound, warnings] = loadlibrary('wvdll','wvdll.dll','wvdll.h','mfilename');
%[notfound, warnings] = loadlibrary('wvdll','wvdll.h');
libfunctions('wvdll');
end
and that's the error that I got: Error using loadlibrary (line 153) Option wvdll.h is not a valid loadlibrary option.
Error in Main (line 15) [notfound, warnings] = loadlibrary ('wvdll','wvdll.dll','wvdll.h','mfilename');
if some-one can help with that I will be more the grateful.
matan.
1 commentaire
matan
le 15 Juin 2014
Réponses (1)
Geoff Hayes
le 15 Juin 2014
Check out the documentation for loadlibrary at http://www.mathworks.com/help/matlab/ref/loadlibrary.html. Your line of code
loadlibrary('wvdll','wvdll.dll','wvdll.h','mfilename');
raises the error Option wvdll.h is not a valid loadlibrary option because this line is using the header file as the third input which is reserved for the name-value (as fourth input) pair arguments. Since the name of the header file is the same as the dll, try using just
loadlibrary('wvdll');
making sure the path to the dll has been added to the search path. See http://www.mathworks.com/help/matlab/ref/loadlibrary.html#btgwwzn for an example.
8 commentaires
matan
le 15 Juin 2014
Geoff Hayes
le 15 Juin 2014
What happens when you run the command
[notfound,warnings] = loadlibrray('wvdll');
matan
le 15 Juin 2014
Geoff Hayes
le 16 Juin 2014
What does mex.getCompilerConfigurations('C','Selected') return? Have you checked http://e2e.ti.com/support for similar queries of using MATLAB and this dll?
matan
le 16 Juin 2014
Geoff Hayes
le 16 Juin 2014
As for setting up mex, there is no space between the dash and setup like you have above. It is just
mex -setup
So you can try that again.
matan
le 17 Juin 2014
Geoff Hayes
le 17 Juin 2014
The 64 bit MATLAB vs 32 bit dll could be the problem. You should look at the link http://e2e.ti.com/support/data_converters/high_speed_data_converters/f/68/t/224003.aspx which outlines a similar issue. As for your second question, I have no background to suggest what you should do there.
Catégories
En savoir plus sur MATLAB Compiler SDK 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!