Using static library in Matlab
9 views (last 30 days)
Show older comments
I have a 64 bit Linux static library propa64.a, and a corresponding propa.h file with several calls to windows.h, math.h, etc, and description for the functions of the library. I'm trying to use those functions in matlab (2012b) in Linux, by loading the library:
loadlibrary('propa', '/work/propa/propa.h'),
but i'm getting the error:
Failed to preprocess the input file.
Output from preprocessor
is:/top/students/GRAD/ECE/ltolstoy/home/work/propa/propa.h:1:21: error: windows.h: No
such file or directory
Looks like matlab can't find the called from propa.h other header files, which i know are in
/usr/local/matlab-res.2012b/sys/lcc/include folder, and this path is also in the 'path' variable ( i just added it with the path(path,'/usr/local/matlab-res.2012b/sys/lcc/include/') command.
Please suggest me how to make loadlibrary work with propa64.a, or this is not correct way to use static libraries in matlab?
0 Comments
Answers (2)
Philip Borghesani
on 24 Jun 2014
Static libraries must be turned into dynamic (shared) libraries before they can be used by an existing program. The simplest way to do this for MATLAB is to create a mex file that calls the desired functions in the library.
I think you have other problems though, I doubt that any Linux compatible library requires windows.h on Linux and I have never seen LCC used on with MATLAB on Linux.
0 Comments
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!