Basic Concept Help - Using DLL want to make an interface file - I Only want one file with multiple functions (like a class in ANSI C / C++)
Show older comments
I am a C programmer that has created a DLL that is being requested to be used in MATLAB.
I understand the basics of MATLAB and can make different function files to call different functions from my DLL.
The problem comes that the DLL is quite large and its communication can become complicated for a novice user. So I want to make ONE file with multiple functions that can be called from other Matlab Functionality.
From what I understand only one function can be used externally from a function file (the main function) and a class isn't like a ANSI C class, but is more like a type that does not have functions that can be called.
So what am I to do? How do I get a basic interface to my dll without having to make 40 function files and everytime someone wants to use my DLL they have to have an instance of all these files? I want to make it as easy on the end user as possible by having just one file, and multiple functions they can call
Thanks for any help!
1 Comment
Walter Roberson
on 22 May 2012
?? ANSI C does not have "class"
Answers (1)
Kaustubha Govind
on 22 May 2012
0 votes
I haven't tried this before, but according to the documentation for the mbuild command, you simply need to modify the .exports text file and specify an export list to export multiple functions from a MATLAB Compiler generated shared library.
"mbuild can also create shared libraries from C source code. If a file with the extension .exports is passed to MBUILD, a shared library is built. The .exports file must be a text file, with each line containing either an exported symbol name, or starting with a # or * in the first column (in which case it is treated as a comment line). If multiple .exports files are specified, all symbol names in all specified .exports files are exported."
Categories
Find more on C Shared Library Integration 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!