Compiler and shared C library
1 view (last 30 days)
Show older comments
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 Comments
Walter Roberson
on 8 Jun 2013
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.
Answers (0)
See Also
Categories
Find more on MATLAB Compiler 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!