MATLAB: Making cpp code from Mfile.

mcc

Hi all, I would like to use Matlab functions in my cpp project. I used command: mcc -W cpplib:liba -T link:lib odw, where odw is my Mfile. Matlab generated several files: liba.cpp liba.dll liba.exp liba.h liba.lib liba.export. I joined liba.cpp and liba.h to my Cpp, but it doesn't work. It doesn't see mclmcrrt.h and mclcppclass.h. Is it true that i have to join liba.dll too? I create my cpp project in QtCreator.
Thanks for responses! Jan

Best Answer

You need to link against liba.lib, and add the directory containing liba.dll to the system PATH. See C++ Shared Library Example.