Using static library in Matlab
조회 수: 8 (최근 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!