Using static library in Matlab
9 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Philip Borghesani
2014-6-24
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!