Reputation: 1
I need generate Dll file from matlab cods and use this in C++. I can not couple dll file in c++. Please help me.
Upvotes: 0
Views: 663
Reputation: 5689
This looks promising: How do I create a C - shared library with MATLAB Compiler 3.0 which can be used in other projects?
In short:
Compile your MATLAB files into a DLL (on Windows): mcc -t -L C -W lib:mylib -T link:lib -h <MATLAB files> libmmfile.mlib
Add mylib.lib
to your MSVC (or your own IDE) project
Make sure to call the initialization and termination routines from your
code before calling any of the MATLAB files that are compiled. You need to call: mylibInitialize();
Afterwards, you should call the termination routine: mylibTerminate();
All of the symbols in mylib.dll
will also appear in mylib.h
.
You can call the functions compiled from the MATLAB code by invoking mlfFoo(...)
, from your C code.
Upvotes: 3