Compiler and shared C library
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi all,
I am trying to understand how to use the Compiler toolbox to distribute a shared C library. What I currently have in MATLAB is 5 functions, each in its own .m file, and each one can be run essentially as a standalone. That is, you call one of the functions, pass some arguments, it runs for a few minutes and returns some values. I also have a separate directory in the MATLAB path that contains all sorts of functions that I am calling from my 5 main functions. I will refer to this as the '.m library folder'. Some of these I created myself, some I downloaded from FEX. What I want to do is generate each of the 5 functions as a separate C shared library, so that each can be called separately from C. How do I go about doing this? Do I create 5 separate projects in the Compiler toolbox? Do I include the .m library folder with each project or can I compile each of those files separately and link them later?
댓글 수: 2
Walter Roberson
2013년 6월 8일
Do you need 5 different entry points to the same library, or do you need 5 different libraries? If you used different libraries the implication would be that each different library would be able to do just one thing and users would have to link multiple libraries if they wanted to be able to call more than one function. If you used one library with 5 entry points, all the code would be in one library and the user could link just the one and use any of the functions from it.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!