how do i load dll files with loadlibrary function?
显示 更早的评论
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 个)
Geoff Hayes
2014-6-15
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 个评论
matan
2014-6-15
Geoff Hayes
2014-6-15
What happens when you run the command
[notfound,warnings] = loadlibrray('wvdll');
matan
2014-6-15
Geoff Hayes
2014-6-16
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
2014-6-16
Geoff Hayes
2014-6-16
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
2014-6-17
Geoff Hayes
2014-6-17
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.
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Compiler SDK 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!