Loadlibrary does not work with DLL function

2 views (last 30 days)
pieterjan
pieterjan on 2 Dec 2014
Edited: pieterjan on 3 Dec 2014
Hi,
I have a DLL and a lib-file from my countries' geographic institute with functions which can convert latlon coordinates to xy. Also a pdf with function declarations was provided.
I am not experienced with c-code but I am trying to comprehend. To start I have tried the following:
>> loadlibrary('ETRS89_LAMBERT_UTM_32bits')
Error using loadlibrary>lFullPath (line 604)
Could not find file ETRS89_LAMBERT_UTM_32bits.h.
Error in loadlibrary (line 219)
header=lFullPath(header);
So it seems I need a header file to load the dll functions. The structure of the lib-file seems like a header I think, so I've tried the following:
>> loadlibrary('ETRS89_LAMBERT_UTM_32bits', 'ETRS89_LAMBERT_UTM_32bits.lib')
Warning: Message from C preprocessor:
cl : Command line warning D9027 : source file
'C:\Users\pieterjan\Desktop\Verification Measurement Campaigns\Matlab\geomatica
toolbox\NIG\32bit\ETRS89_LAMBERT_UTM_32bits.lib' ignored
cl : Command line warning D9021 : no action performed
> In loadlibrary at 321
Something with the header has gone wrong apparently, but the function libisloaded says the library was loaded. If I ask an overview of the functions, I get the following answer:
>> libfunctions('ETRS89_LAMBERT_UTM_32bits')
No methods for class lib.ETRS89_LAMBERT_UTM_32bits.
Does anybody know a simple solution to make this library work in Matlab ?
Thanks in advance!

Answers (2)

Philip Borghesani
Philip Borghesani on 2 Dec 2014
You need a C header file (somefile.h) to load a library in MATLAB it is possible that you can create one by pasting the decelerations from the documentation in the pdf into a new text file to create the header file.
The lib file is of no use with loadlibrary in MATLAB.

pieterjan
pieterjan on 3 Dec 2014
Edited: pieterjan on 3 Dec 2014
Thanks for your answer.
I have looked up some examples of header files and have tried two header files in the attachment. (I am only trying to load one of the functions of the dll to siplify the learning process)
When I use Loadlibrary, I get no error message. But I still get the answer that there are no known methods for this library:
>> libfunctions('ETRS89_LAMBERT_UTM_32bits')
No methods for class lib.ETRS89_LAMBERT_UTM_32bits.
Do you have an idea what might be the problem?

Products

Community Treasure Hunt

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

Start Hunting!